Skip to content

feat(telemetry): align transport spans with semconv#123

Merged
yordis merged 10 commits intomainfrom
yordis/feat-otel-semconv
Apr 13, 2026
Merged

feat(telemetry): align transport spans with semconv#123
yordis merged 10 commits intomainfrom
yordis/feat-otel-semconv

Conversation

@yordis
Copy link
Copy Markdown
Member

@yordis yordis commented Apr 13, 2026

  • Align transport-level telemetry with OpenTelemetry semantic conventions so HTTP ingress and NATS messaging can be queried consistently across services.
  • Reduce span attribute drift by centralizing shared telemetry keys instead of letting boundary instrumentation diverge over time.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

Warning

Rate limit exceeded

@yordis has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 2 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 2 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9a51ce89-3be3-4f61-9954-e2906345aae8

📥 Commits

Reviewing files that changed from the base of the PR and between 3b4a2e8 and 50169b8.

📒 Files selected for processing (3)
  • rsworkspace/crates/trogon-nats/src/messaging.rs
  • rsworkspace/crates/trogon-std/Cargo.toml
  • rsworkspace/crates/trogon-std/src/telemetry/http.rs

Walkthrough

Added OpenTelemetry-based HTTP and NATS messaging instrumentation: new telemetry-http feature in trogon-std (HTTP instrumentation), integration of that feature into acp-nats-ws and trogon-gateway, and NATS span/attribute helpers plus instrumentation in trogon-nats.

Changes

Cohort / File(s) Summary
Workspace deps
rsworkspace/Cargo.toml
Added opentelemetry-semantic-conventions = "=0.31.0" (workspace dependency with semconv_experimental).
trogon-std: feature + HTTP telemetry
rsworkspace/crates/trogon-std/Cargo.toml, rsworkspace/crates/trogon-std/src/lib.rs, rsworkspace/crates/trogon-std/src/telemetry/mod.rs, rsworkspace/crates/trogon-std/src/telemetry/http.rs
Added telemetry-http feature and optional dependencies; implemented telemetry::http::instrument_router and helpers to compute/set OpenTelemetry HTTP server attributes (request/response) with tests.
acp-nats-ws integration
rsworkspace/crates/acp-nats-ws/Cargo.toml, rsworkspace/crates/acp-nats-ws/src/main.rs
Enabled trogon-std telemetry-http feature and replaced direct tower_http::trace::TraceLayer usage with trogon_std::telemetry::http::instrument_router(...); removed direct tower-http dependency.
trogon-gateway integration
rsworkspace/crates/trogon-gateway/Cargo.toml, rsworkspace/crates/trogon-gateway/src/main.rs
Enabled telemetry-http feature on trogon-std and wrapped the mounted router with instrument_router(...) before serving.
trogon-nats: messaging telemetry
rsworkspace/crates/trogon-nats/Cargo.toml, rsworkspace/crates/trogon-nats/src/lib.rs, rsworkspace/crates/trogon-nats/src/messaging.rs, rsworkspace/crates/trogon-nats/src/telemetry/mod.rs, rsworkspace/crates/trogon-nats/src/telemetry/messaging.rs
Added workspace dependency; declared telemetry module; instrumented request_with_timeout and publish with #[instrument(...)], added span attribute wiring and error tagging (helpers in new telemetry/messaging.rs), and added tests for serialization/publish failures.

Sequence Diagram

sequenceDiagram
    participant Client
    participant Instrument as InstrumentRouter
    participant Router
    participant Handler
    participant Telemetry as OpenTelemetry

    Client->>Instrument: HTTP Request
    activate Instrument
    Instrument->>Telemetry: Create span "http.server.request"
    Instrument->>Instrument: Set request attributes (method, path, host, user-agent, proto)
    Instrument->>Router: Forward request
    activate Router
    Router->>Handler: Invoke handler
    activate Handler
    Handler-->>Router: Response
    deactivate Handler
    Router-->>Instrument: Response
    deactivate Router
    Instrument->>Telemetry: Set response attributes (status)
    Instrument-->>Client: HTTP Response
    deactivate Instrument
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through spans both near and far,
Marked NATS subjects and each HTTP jar,
I set the attrs, then gave a cheer,
Traces now hum and logs are clear,
A tiny rabbit celebrates observability! 🎩✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(telemetry): align transport spans with semconv' directly and specifically describes the main change—aligning telemetry spans with semantic conventions across transport layers.
Description check ✅ Passed The description is clearly related to the changeset, explaining the motivation for aligning transport-level telemetry with OpenTelemetry semantic conventions and reducing span attribute drift.
Docstring Coverage ✅ Passed Docstring coverage is 80.49% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/feat-otel-semconv

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 13, 2026

PR Summary

Medium Risk
Changes HTTP and NATS instrumentation paths (new span names/attributes and error tagging), which can affect observability queries and add minor runtime overhead. Core request/publish behavior is largely unchanged but is touched to record telemetry on error paths.

Overview
Aligns transport-level telemetry with OpenTelemetry semantic conventions by introducing standardized HTTP server and NATS messaging span attributes.

Adds a new trogon-std telemetry-http feature exposing telemetry::http::instrument_router, and updates acp-nats-ws and trogon-gateway to use it instead of local TraceLayer wiring.

Enhances trogon-nats request_with_timeout and publish with #[instrument] spans plus centralized semantic-convention attributes and error.type tagging via a new internal telemetry::messaging module; expands tests to cover serialization failures and publish/flush error paths, and wires in opentelemetry-semantic-conventions workspace dependency.

Reviewed by Cursor Bugbot for commit 50169b8. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

badge

Code Coverage Summary

Details
Filename                                                                      Stmts    Miss  Cover    Missing
--------------------------------------------------------------------------  -------  ------  -------  ---------------------------------------------------------------------------------------------
crates/acp-nats/src/jetstream/streams.rs                                        194       4  97.94%   254-256, 266
crates/acp-nats/src/jetstream/provision.rs                                       61       0  100.00%
crates/acp-nats/src/jetstream/consumers.rs                                       99       0  100.00%
crates/acp-nats/src/jetstream/ext_policy.rs                                      26       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/prompt_wildcard.rs               11       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_agent.rs                     11       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/one_client.rs                    18       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_agent_ext.rs                 11       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/global_all.rs                    11       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/one_session.rs                   18       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/one_agent.rs                     18       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_session.rs                   11       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_client.rs                    11       0  100.00%
crates/acp-nats/src/acp_prefix.rs                                                51       0  100.00%
crates/acp-nats/src/in_flight_slot_guard.rs                                      32       0  100.00%
crates/acp-nats/src/lib.rs                                                       73       0  100.00%
crates/acp-nats/src/req_id.rs                                                    39       0  100.00%
crates/acp-nats/src/ext_method_name.rs                                           70       0  100.00%
crates/acp-nats/src/pending_prompt_waiters.rs                                   141       0  100.00%
crates/acp-nats/src/session_id.rs                                                72       0  100.00%
crates/acp-nats/src/client_proxy.rs                                             200       0  100.00%
crates/acp-nats/src/jsonrpc.rs                                                    6       0  100.00%
crates/acp-nats/src/config.rs                                                   204       0  100.00%
crates/acp-nats/src/error.rs                                                     84       0  100.00%
crates/acp-nats/src/nats/parsing.rs                                             285       1  99.65%   153
crates/acp-nats/src/nats/mod.rs                                                  23       0  100.00%
crates/acp-nats/src/nats/extensions.rs                                            3       0  100.00%
crates/trogon-source-linear/src/signature.rs                                     54       1  98.15%   16
crates/trogon-source-linear/src/config.rs                                        17       0  100.00%
crates/trogon-source-linear/src/server.rs                                       392       0  100.00%
crates/trogon-source-telegram/src/server.rs                                     387       0  100.00%
crates/trogon-source-telegram/src/config.rs                                      17       0  100.00%
crates/trogon-source-telegram/src/signature.rs                                   38       0  100.00%
crates/acp-nats/src/client/fs_read_text_file.rs                                 384       0  100.00%
crates/acp-nats/src/client/terminal_create.rs                                   294       0  100.00%
crates/acp-nats/src/client/mod.rs                                              2987       0  100.00%
crates/acp-nats/src/client/terminal_release.rs                                  357       0  100.00%
crates/acp-nats/src/client/rpc_reply.rs                                          71       0  100.00%
crates/acp-nats/src/client/request_permission.rs                                338       0  100.00%
crates/acp-nats/src/client/terminal_kill.rs                                     309       0  100.00%
crates/acp-nats/src/client/ext_session_prompt_response.rs                       157       0  100.00%
crates/acp-nats/src/client/terminal_output.rs                                   223       0  100.00%
crates/acp-nats/src/client/ext.rs                                               365       8  97.81%   193-204, 229-240
crates/acp-nats/src/client/session_update.rs                                     55       0  100.00%
crates/acp-nats/src/client/terminal_wait_for_exit.rs                            396       0  100.00%
crates/acp-nats/src/client/fs_write_text_file.rs                                451       0  100.00%
crates/trogon-std/src/fs/system.rs                                              102       0  100.00%
crates/trogon-std/src/fs/mem.rs                                                 220      10  95.45%   61-63, 77-79, 133-135, 158
crates/trogon-source-incidentio/src/incidentio_event_type.rs                     67       0  100.00%
crates/trogon-source-incidentio/src/signature.rs                                455       0  100.00%
crates/trogon-source-incidentio/src/incidentio_signing_secret.rs                 67       0  100.00%
crates/trogon-source-incidentio/src/server.rs                                   365       0  100.00%
crates/trogon-source-incidentio/src/config.rs                                    16       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_release.rs                 15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/fs_write_text_file.rs               15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/fs_read_text_file.rs                15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_wait_for_exit.rs           15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_kill.rs                    15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_create.rs                  15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_output.rs                  15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/session_request_permission.rs       15       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/session_update.rs                   15       0  100.00%
crates/trogon-source-github/src/signature.rs                                     64       0  100.00%
crates/trogon-source-github/src/server.rs                                       351       0  100.00%
crates/trogon-source-github/src/config.rs                                        17       0  100.00%
crates/acp-nats/src/nats/subjects/global/initialize.rs                            8       0  100.00%
crates/acp-nats/src/nats/subjects/global/ext.rs                                  12       0  100.00%
crates/acp-nats/src/nats/subjects/global/ext_notify.rs                           12       0  100.00%
crates/acp-nats/src/nats/subjects/global/session_list.rs                          8       0  100.00%
crates/acp-nats/src/nats/subjects/global/authenticate.rs                          8       0  100.00%
crates/acp-nats/src/nats/subjects/global/logout.rs                                8       0  100.00%
crates/acp-nats/src/nats/subjects/global/session_new.rs                           8       0  100.00%
crates/trogon-source-notion/src/signature.rs                                     63       1  98.41%   32
crates/trogon-source-notion/src/notion_verification_token.rs                     17       0  100.00%
crates/trogon-source-notion/src/server.rs                                       351       8  97.72%   100-104, 137-138, 162-163
crates/trogon-source-notion/src/notion_event_type.rs                             48       3  93.75%   49-51
crates/trogon-std/src/json.rs                                                    30       0  100.00%
crates/trogon-std/src/secret_string.rs                                           35       0  100.00%
crates/trogon-std/src/duration.rs                                                45       0  100.00%
crates/trogon-std/src/http.rs                                                    19       0  100.00%
crates/trogon-std/src/args.rs                                                    10       0  100.00%
crates/trogon-nats/src/lease/acquire.rs                                           8       8  0.00%    9-18
crates/trogon-nats/src/lease/lease_bucket.rs                                     19       0  100.00%
crates/trogon-nats/src/lease/mod.rs                                             603      13  97.84%   182-195
crates/trogon-nats/src/lease/provision.rs                                       210      10  95.24%   84-94
crates/trogon-nats/src/lease/ttl.rs                                              76       0  100.00%
crates/trogon-nats/src/lease/nats_kv_lease_config.rs                             30       0  100.00%
crates/trogon-nats/src/lease/lease_timing.rs                                     21       0  100.00%
crates/trogon-nats/src/lease/lease_key.rs                                        19       0  100.00%
crates/trogon-nats/src/lease/renew_interval.rs                                   61       0  100.00%
crates/trogon-nats/src/lease/release.rs                                           5       5  0.00%    8-12
crates/trogon-nats/src/lease/renew.rs                                           263      19  92.78%   21-27, 46-57
crates/trogon-nats/src/lease/lease_config_error.rs                               13       0  100.00%
crates/trogon-gateway/src/http.rs                                               114       0  100.00%
crates/trogon-gateway/src/source_status.rs                                       32       0  100.00%
crates/trogon-gateway/src/config.rs                                            1371       0  100.00%
crates/trogon-gateway/src/main.rs                                                 4       0  100.00%
crates/trogon-gateway/src/streams.rs                                            128       0  100.00%
crates/acp-nats/src/nats/subjects/commands/set_config_option.rs                  18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/prompt.rs                             18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/set_mode.rs                           18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/cancel.rs                             18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/set_model.rs                          18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/resume.rs                             18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/close.rs                              18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/fork.rs                               18       0  100.00%
crates/acp-nats/src/nats/subjects/commands/load.rs                               18       0  100.00%
crates/trogon-std/src/dirs/system.rs                                             76       0  100.00%
crates/trogon-std/src/dirs/fixed.rs                                              84       0  100.00%
crates/acp-nats/src/agent/bridge.rs                                             123       4  96.75%   109-112
crates/acp-nats/src/agent/prompt.rs                                             633       0  100.00%
crates/acp-nats/src/agent/set_session_mode.rs                                    71       0  100.00%
crates/acp-nats/src/agent/new_session.rs                                         91       0  100.00%
crates/acp-nats/src/agent/list_sessions.rs                                       50       0  100.00%
crates/acp-nats/src/agent/test_support.rs                                       299       0  100.00%
crates/acp-nats/src/agent/cancel.rs                                             105       0  100.00%
crates/acp-nats/src/agent/load_session.rs                                       101       0  100.00%
crates/acp-nats/src/agent/ext_method.rs                                          92       0  100.00%
crates/acp-nats/src/agent/logout.rs                                              49       0  100.00%
crates/acp-nats/src/agent/initialize.rs                                          83       0  100.00%
crates/acp-nats/src/agent/js_request.rs                                         304       0  100.00%
crates/acp-nats/src/agent/set_session_model.rs                                   71       0  100.00%
crates/acp-nats/src/agent/mod.rs                                                 65       0  100.00%
crates/acp-nats/src/agent/authenticate.rs                                        52       0  100.00%
crates/acp-nats/src/agent/close_session.rs                                       67       0  100.00%
crates/acp-nats/src/agent/resume_session.rs                                     102       0  100.00%
crates/acp-nats/src/agent/set_session_config_option.rs                           71       0  100.00%
crates/acp-nats/src/agent/ext_notification.rs                                    88       0  100.00%
crates/acp-nats/src/agent/fork_session.rs                                       106       0  100.00%
crates/acp-nats/src/nats/subjects/responses/cancelled.rs                         18       0  100.00%
crates/acp-nats/src/nats/subjects/responses/ext_ready.rs                         15       0  100.00%
crates/acp-nats/src/nats/subjects/responses/prompt_response.rs                   27       0  100.00%
crates/acp-nats/src/nats/subjects/responses/response.rs                          20       0  100.00%
crates/acp-nats/src/nats/subjects/responses/update.rs                            27       0  100.00%
crates/trogon-nats/src/client.rs                                                 25      25  0.00%    50-89
crates/trogon-nats/src/auth.rs                                                  119       0  100.00%
crates/trogon-nats/src/connect.rs                                               105      11  89.52%   22-24, 37, 49, 68-73
crates/trogon-nats/src/token.rs                                                   8       0  100.00%
crates/trogon-nats/src/messaging.rs                                             598       2  99.67%   153, 163
crates/trogon-nats/src/mocks.rs                                                 304       0  100.00%
crates/trogon-nats/src/nats_token.rs                                            161       0  100.00%
crates/trogon-service-config/src/lib.rs                                          98       0  100.00%
crates/acp-nats-ws/src/connection.rs                                            166      35  78.92%   75-82, 87-98, 114, 116-117, 122, 133-135, 142, 146, 150, 153-161, 172, 176, 179, 182-186, 220
crates/acp-nats-ws/src/upgrade.rs                                                57       2  96.49%   59, 90
crates/acp-nats-ws/src/main.rs                                                  189      18  90.48%   89, 209-230, 308
crates/acp-nats-ws/src/config.rs                                                 83       0  100.00%
crates/trogon-nats/src/telemetry/messaging.rs                                   102       0  100.00%
crates/trogon-source-slack/src/server.rs                                        954       0  100.00%
crates/trogon-source-slack/src/signature.rs                                      80       0  100.00%
crates/trogon-source-slack/src/config.rs                                         17       0  100.00%
crates/trogon-std/src/telemetry/http.rs                                         239       0  100.00%
crates/trogon-source-gitlab/src/config.rs                                        17       0  100.00%
crates/trogon-source-gitlab/src/server.rs                                       431       0  100.00%
crates/trogon-source-gitlab/src/signature.rs                                     30       0  100.00%
crates/trogon-std/src/time/mock.rs                                              129       0  100.00%
crates/trogon-std/src/time/system.rs                                             35       0  100.00%
crates/trogon-nats/src/jetstream/claim_check.rs                                 372       0  100.00%
crates/trogon-nats/src/jetstream/stream_max_age.rs                               18       0  100.00%
crates/trogon-nats/src/jetstream/mocks.rs                                       740      44  94.05%   368-382, 388-396, 411-422, 436-446, 514-516
crates/trogon-nats/src/jetstream/traits.rs                                       43      43  0.00%    140-208
crates/trogon-nats/src/jetstream/publish.rs                                      64       0  100.00%
crates/acp-nats-agent/src/connection.rs                                        1434       1  99.93%   686
crates/acp-nats-stdio/src/main.rs                                               141      27  80.85%   64, 116-123, 129-131, 148, 179-200
crates/acp-nats-stdio/src/config.rs                                              72       0  100.00%
crates/trogon-source-discord/src/config.rs                                      109       0  100.00%
crates/trogon-source-discord/src/gateway.rs                                     491       1  99.80%   157
crates/acp-nats/src/nats/subjects/mod.rs                                        380       0  100.00%
crates/acp-nats/src/nats/subjects/stream.rs                                      58       0  100.00%
crates/acp-nats/src/telemetry/metrics.rs                                         65       0  100.00%
crates/trogon-std/src/env/system.rs                                              17       0  100.00%
crates/trogon-std/src/env/in_memory.rs                                           81       0  100.00%
crates/acp-telemetry/src/trace.rs                                                32       3  90.62%   23-24, 32
crates/acp-telemetry/src/service_name.rs                                         49       0  100.00%
crates/acp-telemetry/src/signal.rs                                                7       1  85.71%   43
crates/acp-telemetry/src/lib.rs                                                 169      32  81.07%   28-34, 56-63, 98, 103, 108, 122-137, 174, 177, 180, 186
crates/acp-telemetry/src/log.rs                                                  71       1  98.59%   43
crates/acp-telemetry/src/metric.rs                                               35       3  91.43%   30-31, 39
TOTAL                                                                         26040     344  98.68%

Diff against main

Filename                                         Stmts    Miss  Cover
---------------------------------------------  -------  ------  --------
crates/trogon-nats/src/messaging.rs                +46       0  +0.03%
crates/trogon-nats/src/telemetry/messaging.rs     +102       0  +100.00%
crates/trogon-std/src/telemetry/http.rs           +239       0  +100.00%
TOTAL                                             +387       0  +0.02%

Results for commit: 50169b8

Minimum allowed coverage is 95%

♻️ This comment has been updated with latest results

Comment thread rsworkspace/crates/trogon-gateway/src/main.rs Outdated
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a937e3e. Configure here.

Comment thread rsworkspace/crates/acp-nats-ws/src/main.rs
yordis added 3 commits April 13, 2026 14:16
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rsworkspace/crates/trogon-nats/src/messaging.rs`:
- Around line 83-89: The deserialize error handler around
serde_json::from_slice(&response.payload) in messaging.rs currently logs the
full raw payload; instead, avoid emitting raw bodies by changing the
tracing::error call in that closure (and keep set_span_error(&span,
MessagingError::Deserialize)) to log only safe metadata: the payload length, a
truncated/sanitized preview (e.g., first N UTF-8-safe characters or hex of first
N bytes), and the error; reference the serde_json::from_slice call and the
tracing::error invocation and replace the raw payload_str with a redacted
preview and payload.len() to prevent leaking tokens/PII or huge binary blobs.

In `@rsworkspace/crates/trogon-std/Cargo.toml`:
- Around line 34-35: The Tower dependency in Cargo.toml needs the `util` feature
enabled so the test in trogon-std/src/telemetry/http.rs that imports
`tower::ServiceExt` will compile; update the `tower = "0.5"` entry to include
the util feature (e.g., add features = ["util"]) so the extension trait is
enabled for tests and downstream consumers.

In `@rsworkspace/crates/trogon-std/src/telemetry/http.rs`:
- Around line 23-27: The HTTP ingress span created in tracing::info_span!
("http.server.request" in this file) must include the OpenTelemetry kind tag so
it exports as a server span; update the span creation for method/path to also
set otel.kind = "server" (i.e., add otel.kind = "server" as a field in the
info_span! invocation that constructs the request span) so the span is marked as
a server-side request for OTel exporters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d6304ed-0759-4a61-9a6b-d32b2ccfdd63

📥 Commits

Reviewing files that changed from the base of the PR and between 29026b9 and a880134.

⛔ Files ignored due to path filters (1)
  • rsworkspace/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • rsworkspace/Cargo.toml
  • rsworkspace/crates/acp-nats-ws/Cargo.toml
  • rsworkspace/crates/acp-nats-ws/src/main.rs
  • rsworkspace/crates/trogon-gateway/Cargo.toml
  • rsworkspace/crates/trogon-gateway/src/main.rs
  • rsworkspace/crates/trogon-nats/Cargo.toml
  • rsworkspace/crates/trogon-nats/src/lib.rs
  • rsworkspace/crates/trogon-nats/src/messaging.rs
  • rsworkspace/crates/trogon-nats/src/telemetry/messaging.rs
  • rsworkspace/crates/trogon-nats/src/telemetry/mod.rs
  • rsworkspace/crates/trogon-std/Cargo.toml
  • rsworkspace/crates/trogon-std/src/lib.rs
  • rsworkspace/crates/trogon-std/src/telemetry/http.rs
  • rsworkspace/crates/trogon-std/src/telemetry/mod.rs

Comment thread rsworkspace/crates/trogon-nats/src/messaging.rs
Comment thread rsworkspace/crates/trogon-std/Cargo.toml Outdated
Comment thread rsworkspace/crates/trogon-std/src/telemetry/http.rs
yordis added 5 commits April 13, 2026 15:21
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis merged commit 85f57e0 into main Apr 13, 2026
7 checks passed
@yordis yordis deleted the yordis/feat-otel-semconv branch April 13, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant