activity-tracing
Skill1 starsChanged 5 months agoMITView on GitHub
Guides activity tracing with generated ActivitySources, tags, parent activities, exception status handling, and registration. Use when adding or reviewing OpenTelemetry activity tracing in Bendex flows.
In this repository71 other files it gives its agents.
- unsafe-checker/AGENTS.mdAGENTS.md
- beadsSkill
- code-analysis-warningsSkill
- coding-guidelinesSkill
- compiler-warningsSkill
- core-actionbookSkill
- core-agent-browserSkill
- core-dynamic-skillsSkill
- core-fix-skill-docsSkill
- csharp-compiler-warningsSkill
- csharp-object-designSkill
- domain-cliSkill
- domain-cloud-nativeSkill
- domain-embeddedSkill
- domain-fintechSkill
- domain-iotSkill
- domain-mlSkill
- domain-webSkill
- dotnet-pinvokeSkill
- dreamSkill
- gitSkill
- ide-warningsSkill
- karpathy-guidelinesSkill
- m01-ownershipSkill
- m02-resourceSkill
- m03-mutabilitySkill
- m04-zero-costSkill
- m05-type-drivenSkill
- m06-error-handlingSkill
- m07-concurrencySkill
- m09-domainSkill
- m10-performanceSkill
- m11-ecosystemSkill
- m12-lifecycleSkill
- m13-domain-errorSkill
- m14-mental-modelSkill
- m15-anti-patternSkill
- mermaidSkill
- meta-cognition-parallelSkill
- modern-csharpSkill
- msbuild-warningsSkill
- mx-creative-keypadSkill
- nuget-warningsSkill
- nullability-warningsSkill
- rcs-warningsSkill
- renpySkill
- rust-call-graphSkill
- rust-code-navigatorSkill
- rust-dailySkill
- rust-deps-visualizerSkill
- rust-learnerSkill
- rust-object-designSkill
- rust-refactor-helperSkill
- rust-routerSkill
- rust-skill-creatorSkill
- rustSkill
- rust-symbol-analyzerSkill
- rust-trait-explorerSkill
- translationsSkill
- understand-chatSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Use activity tracing for user-triggered flows, important domain actions, and cross-component transitions where we need to see call order …
- Distinctive: line 8
Do not add activity tracking to
- Very specific: line 15
Prefer activity tracing instead of LogDebug in methods that are traced.
- Very specific: line 17
Ensure the class has [GenerateActivitySources] and using System.Diagnostics;.
- Very specific: line 19
Add key inputs via activity?.AddTag("arg.<name>", value);.
- Very specific: line 21
If a method has a parent activity, pass it through to downstream calls and to Create(parentActivity).
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Activity Tracing
- Use activity tracing for user-triggered flows, important domain actions, and cross-component transitions where we need to see call order and inputs.
- Do not add activity tracking to
- Constructors, destructors
- HandleCreated events
Dispose()methods.- Properties (including
Get<PropertyName>()orSet<PropertyName>()methods) - Methods that are called often, like
OnLoad(),OnDraw()orOnMouseMove() - *.Designer.cs files
- Prefer activity tracing instead of
LogDebugin methods that are traced; remove those debug logs when adding tracing. - Implementation pattern:
- Ensure the class has
[GenerateActivitySources]andusing System.Diagnostics;. - Wrap method bodies with
using var activity = <Type>ActivitySources.<MethodName>.Create(parentActivity);. - Add key inputs via
activity?.AddTag("arg.<name>", value);. - On exceptions:
activity?.AddException(ex); activity?.SetStatus(ActivityStatusCode.Error, ex.Message);then rethrow. - If a method has a parent activity, pass it through to downstream calls and to
Create(parentActivity). - Register the generated activity sources in the module
ActivitySources.cs(e.g. add.Concat(<Type>ActivitySources.GetAll())to the module'sGetAll()method).
- Ensure the class has
Example:
[GenerateActivitySources]
public sealed class ExampleService
{
public void DoWork(int stepIndex, Activity? parentActivity = null)
{
using var activity = ExampleServiceActivitySources.DoWork.Create(parentActivity);
activity?.AddTag("arg.stepIndex", stepIndex);
try
{
// work here
}
catch (Exception ex)
{
activity?.AddException(ex);
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
throw;
}
}
}Event Handler:
public void OnSomeEvent(object? sender, EventArgs args)
{
using var activity = ExampleServiceActivitySources.OnSomeEvent.Create();
try
{
// work here
}
catch (Exception ex)
{
activity?.AddException(ex);
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
throw;
}
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

