docs(mofa-monitoring): Add English doc comments and usage examples#1271
Open
magic-peach wants to merge 2 commits intomofa-org:mainfrom
Open
docs(mofa-monitoring): Add English doc comments and usage examples#1271magic-peach wants to merge 2 commits intomofa-org:mainfrom
magic-peach wants to merge 2 commits intomofa-org:mainfrom
Conversation
- Expand SamplingStrategy variants with usage guidance and when-to-use table - Add # Example block to TracerConfig showing builder pattern - Add Quick Start section to README with working code example - Document OTLP environment variables in a reference table
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a76a26d74d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ion, exporters Building on mofa-org#1319 follow-up to a76a26d: tracer.rs - SimpleSpanProcessor: document latency trade-off vs BatchSpanProcessor - BatchSpanProcessor: document buffering behaviour and config knobs - TracerProvider: add full usage example (exporter → processor → provider) - GlobalTracer: document singleton pattern instrumentation.rs - AgentTracer: add usage example with start_operation/end_span - TracedAgent: explain the wrapper pattern - trace_agent_operation: add full example with closure exporter.rs - OtlpConfig: document all fields; add OTEL_EXPORTER_OTLP_* env-var reference - OtlpExporter: list compatible backends; note Jaeger OTLP vs legacy Thrift span.rs - SpanKind: replace terse bilingual comments with a semantic table explaining how backends use each variant for service maps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
47 tasks
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #1319. The
mofa-monitoringtracing module had many public types with only brief bilingual inline comments and no Rust///doc-comments with examples or usage guidance. This PR adds the missing documentation.Changes
src/tracing/tracer.rsSamplingStrategy: full when-to-use table and code example for each variantTracerConfig:# Examplesblock showing the builder patternSimpleSpanProcessor: document the latency trade-off vsBatchSpanProcessorBatchSpanProcessor: document buffering behaviour, config knobs, and the importance offorce_flushbefore shutdownTracerProvider: full usage example (exporter → processor → provider → tracer)GlobalTracer: document the process-wide singleton patternsrc/tracing/instrumentation.rsAgentTracer: add usage example withstart_operation/end_spanTracedAgent: explain the wrapper pattern and when to use ittrace_agent_operation: add complete example with closuresrc/tracing/exporter.rsOtlpConfig: document all fields; addOTEL_EXPORTER_OTLP_*environment variable reference tableOtlpExporter: list compatible backends; note that Jaeger ≥ 1.35 OTLP port (4317/4318) should be used instead of the deprecated Thrift UDP agentsrc/tracing/span.rsSpanKind: replace terse bilingual comments with a semantic table explaining how tracing backends use each variant for service dependency mapsTest plan
cargo doc -p mofa-monitoring --no-deps— no warningsPart of the GSoC work tracked in #1318.
🤖 Generated with Claude Code