Skip to content

Structured logging with open telemetry semantic conventions #118

Open
clintjeff2 wants to merge 3 commits into
Utility-Protocol:mainfrom
clintjeff2:Structured-Logging-with-OpenTelemetry-Semantic-Conventions-#73
Open

Structured logging with open telemetry semantic conventions #118
clintjeff2 wants to merge 3 commits into
Utility-Protocol:mainfrom
clintjeff2:Structured-Logging-with-OpenTelemetry-Semantic-Conventions-#73

Conversation

@clintjeff2

Copy link
Copy Markdown
Contributor

Motivation

  • Provide a deterministic, schema'd contract event payload aligned with OpenTelemetry semantic conventions for critical billing paths.
  • Make it easy for indexers and telemetry pipelines to correlate domain events with latency SLOs and error rates without increasing storage or cross-contract work.

Description

  • Add OtelLogRecord contracttype and emit_otel_log helper to publish a single otel.log event with a 100 ms critical_path_budget_ms field in contracts/utility_contracts/src/lib.rs.
  • Instrument critical billing paths to emit structured logs for meter.registered, meter.top_up, provider.claim, and usage.updated.
  • Add unit tests validating the OtelLogRecord fields and that emit_otel_log publishes the otel.log event in contracts/utility_contracts/src/otel_logging_tests.rs.
  • Document the design, OpenTelemetry field mapping, monitoring/alerting guidance, and blue-green/canary deployment runbook in contracts/docs/specs/otel-structured-logging.md.

Testing

  • Ran rustfmt on the new test file successfully.
  • Attempted cargo test --manifest-path contracts/utility_contracts/Cargo.toml otel_logging_tests --lib, but execution was blocked by pre-existing, unrelated compile errors in the utility_contracts crate so the new tests could not be fully validated.
  • Ran cargo check --manifest-path contracts/utility_contracts/Cargo.toml --lib, which also surfaced unrelated compile failures in the crate (duplicate constant, symbol length issues, and several pre-existing API/signature mismatches).

Closes #73

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.

Structured Logging with OpenTelemetry Semantic Conventions

1 participant