{"id":"1146eec9-c697-4b82-8eab-8f145a007702","shortId":"wNwARt","kind":"skill","title":"183-observability-tracing-opentelemetry","tagline":"Use when you need to implement or improve distributed tracing with OpenTelemetry in Java — including trace/span modeling, context propagation, semantic conventions, span attributes/events/status, sampling strategy, baggage usage, privacy safeguards, and backend integration with O","description":"# Java Distributed Tracing with OpenTelemetry\n\nImplement robust distributed tracing in Java with OpenTelemetry by modeling meaningful spans, preserving context propagation, and instrumenting critical business and infrastructure paths with low-overhead, privacy-safe telemetry.\n\n**What is covered in this Skill?**\n\n- OpenTelemetry tracing fundamentals for Java services\n- Span design: boundaries, parent/child relationships, and operation naming\n- Context propagation across HTTP, messaging, async tasks, and thread boundaries\n- Semantic conventions and stable attribute naming\n- Error/status/event recording best practices\n- Sampling strategy and performance/cost trade-offs\n- Privacy and security controls for trace attributes\n- Testing and verification of trace propagation and span correctness\n\n**Scope:** Distributed tracing quality in application and integration layers, focused on diagnosability, consistency, and operational safety.\n\n## Constraints\n\nTracing instrumentation must preserve context correctly and avoid leaking sensitive data. Over-instrumentation and high-cardinality attributes can harm cost and signal quality.\n\n- **PROPAGATION FIRST**: Ensure context propagation across all sync/async boundaries before adding extra span detail\n- **NO SENSITIVE DATA**: Never store secrets, credentials, tokens, raw payloads, or PII in span attributes/events\n- **LOW CARDINALITY ATTRIBUTES**: Avoid unbounded values in attributes that are used for aggregation/search\n- **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying tracing changes\n\n## When to use this skill\n\n- Improve tracing\n- Apply OpenTelemetry tracing\n- Add distributed tracing\n- Refactor tracing instrumentation\n\n## Workflow\n\n1. **Define trace model and critical flows**\n\nIdentify high-value request and async flows, define operation boundaries, and choose span names/attributes aligned with semantic conventions.\n\n2. **Instrument and propagate context**\n\nAdd OpenTelemetry spans to key boundaries and ensure trace context is propagated across HTTP clients/servers, messaging, and executor-based async work.\n\n3. **Harden span data and sampling**\n\nRecord status/errors/events consistently, remove sensitive data, control attribute cardinality, and configure sampling/exporters according to environment needs.\n\n4. **Validate traces end-to-end**\n\nVerify parent-child relationships, propagation continuity, and backend visibility through tests and runtime checks.\n\n## Reference\n\nFor detailed guidance, examples, and constraints, see [references/183-observability-tracing-opentelemetry.md](references/183-observability-tracing-opentelemetry.md).","tags":["183","observability","tracing","opentelemetry","cursor","rules","java","jabrena","agent-skills","ai-skills","claude","claude-code"],"capabilities":["skill","source-jabrena","skill-183-observability-tracing-opentelemetry","topic-agent-skills","topic-ai-skills","topic-claude","topic-claude-code","topic-claude-code-skills","topic-claude-code-subagents","topic-claude-skills","topic-cursor-agent","topic-cursor-ai","topic-cursor-skills","topic-cursorai","topic-github-copilot"],"categories":["cursor-rules-java"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/jabrena/cursor-rules-java/183-observability-tracing-opentelemetry","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add jabrena/cursor-rules-java","source_repo":"https://github.com/jabrena/cursor-rules-java","install_from":"skills.sh"}},"qualityScore":"0.642","qualityRationale":"deterministic score 0.64 from registry signals: · indexed on github topic:agent-skills · 384 github stars · SKILL.md body (2,632 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:54:19.513Z","embedding":null,"createdAt":"2026-05-07T12:55:06.855Z","updatedAt":"2026-05-18T18:54:19.513Z","lastSeenAt":"2026-05-18T18:54:19.513Z","tsv":"'/mvnw':224 '1':252 '183':1 '2':278 '3':305 '4':327 'accord':323 'across':97,185,295 'ad':190 'add':245,283 'aggregation/search':221 'align':274 'appli':232,242 'applic':143 'async':100,265,303 'attribut':109,128,173,211,216,318 'attributes/events':208 'attributes/events/status':28 'avoid':162,212 'backend':36,342 'baggag':31 'base':302 'best':113 'boundari':89,104,188,269,288 'busi':63 'cardin':172,210,319 'chang':234 'check':348 'child':337 'choos':271 'clean':225,229 'clients/servers':297 'configur':321 'consist':150,313 'constraint':154,355 'context':23,58,95,159,183,282,292 'continu':340 'control':125,317 'convent':26,106,277 'correct':137,160 'cost':176 'cover':77 'credenti':200 'critic':62,257 'data':165,196,308,316 'defin':253,267 'design':88 'detail':193,351 'diagnos':149 'distribut':14,41,47,139,246 'end':331,333 'end-to-end':330 'ensur':182,290 'environ':325 'error/status/event':111 'exampl':353 'executor':301 'executor-bas':300 'extra':191 'first':181 'flow':258,266 'focus':147 'fundament':83 'guidanc':352 'harden':306 'harm':175 'high':171,261 'high-cardin':170 'high-valu':260 'http':98,296 'identifi':259 'implement':11,45 'improv':13,240 'includ':20 'infrastructur':65 'instrument':61,156,168,250,279 'integr':37,145 'java':19,40,50,85 'key':287 'layer':146 'leak':163 'low':69,209 'low-overhead':68 'meaning':55 'messag':99,298 'model':22,54,255 'must':157 'mvn':228 'name':94,110 'names/attributes':273 'need':9,326 'never':197 'o':39 'observ':3 'observability-tracing-opentelemetri':2 'off':121 'opentelemetri':5,17,44,52,81,243,284 'oper':93,152,268 'over-instrument':166 'overhead':70 'parent':336 'parent-child':335 'parent/child':90 'path':66 'payload':203 'performance/cost':118 'pii':205 'practic':114 'preserv':57,158 'privaci':33,72,122 'privacy-saf':71 'propag':24,59,96,134,180,184,281,294,339 'qualiti':141,179 'raw':202 'record':112,311 'refactor':248 'refer':349 'references/183-observability-tracing-opentelemetry.md':357,358 'relationship':91,338 'remov':314 'request':263 'robust':46 'run':223 'runtim':347 'safe':73 'safeguard':34 'safeti':153 'sampl':29,115,310 'sampling/exporters':322 'scope':138 'secret':199 'secur':124 'see':356 'semant':25,105,276 'sensit':164,195,315 'servic':86 'signal':178 'skill':80,239 'skill-183-observability-tracing-opentelemetry' 'source-jabrena' 'span':27,56,87,136,192,207,272,285,307 'stabl':108 'status/errors/events':312 'store':198 'strategi':30,116 'sync/async':187 'task':101 'telemetri':74 'test':129,345 'thread':103 'token':201 'topic-agent-skills' 'topic-ai-skills' 'topic-claude' 'topic-claude-code' 'topic-claude-code-skills' 'topic-claude-code-subagents' 'topic-claude-skills' 'topic-cursor-agent' 'topic-cursor-ai' 'topic-cursor-skills' 'topic-cursorai' 'topic-github-copilot' 'trace':4,15,42,48,82,127,133,140,155,233,241,244,247,249,254,291,329 'trace/span':21 'trade':120 'trade-off':119 'unbound':213 'usag':32 'use':6,219,237 'valid':328 'valu':214,262 'verif':131 'verifi':222,226,230,334 'visibl':343 'work':304 'workflow':251","prices":[{"id":"88392615-07cd-4d31-ad0b-c99b2bd5bbcd","listingId":"1146eec9-c697-4b82-8eab-8f145a007702","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"jabrena","category":"cursor-rules-java","install_from":"skills.sh"},"createdAt":"2026-05-07T12:55:06.855Z"}],"sources":[{"listingId":"1146eec9-c697-4b82-8eab-8f145a007702","source":"github","sourceId":"jabrena/cursor-rules-java/183-observability-tracing-opentelemetry","sourceUrl":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/183-observability-tracing-opentelemetry","isPrimary":false,"firstSeenAt":"2026-05-07T12:55:06.855Z","lastSeenAt":"2026-05-18T18:54:19.513Z"}],"details":{"listingId":"1146eec9-c697-4b82-8eab-8f145a007702","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"jabrena","slug":"183-observability-tracing-opentelemetry","github":{"repo":"jabrena/cursor-rules-java","stars":384,"topics":["agent-skills","ai-skills","claude","claude-code","claude-code-skills","claude-code-subagents","claude-skills","cursor-agent","cursor-ai","cursor-skills","cursorai","github-copilot","intellij-idea","java","prompting","system-prompts"],"license":"apache-2.0","html_url":"https://github.com/jabrena/cursor-rules-java","pushed_at":"2026-05-18T13:53:37Z","description":"A curated and opinionated collection of Skills and Agents to be used in modern SDLC workflows for Java Enterprise development with your favorite AI Agent harness.","skill_md_sha":"51eaae74fcee713a8df421af6deeec52e3d082a4","skill_md_path":"skills/183-observability-tracing-opentelemetry/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/183-observability-tracing-opentelemetry"},"layout":"multi","source":"github","category":"cursor-rules-java","frontmatter":{"name":"183-observability-tracing-opentelemetry","license":"Apache-2.0","description":"Use when you need to implement or improve distributed tracing with OpenTelemetry in Java — including trace/span modeling, context propagation, semantic conventions, span attributes/events/status, sampling strategy, baggage usage, privacy safeguards, and backend integration with OTLP collectors. This should trigger for requests such as Improve tracing; Apply OpenTelemetry tracing; Add distributed tracing; Refactor tracing instrumentation. Part of cursor-rules-java project"},"skills_sh_url":"https://skills.sh/jabrena/cursor-rules-java/183-observability-tracing-opentelemetry"},"updatedAt":"2026-05-18T18:54:19.513Z"}}