Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

v3: name the JSON log fields after the OpenTelemetry semantic conventions

オープン
#771 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

Start at the v3 --log-format json entry point and compare the current fields with the linked OpenTelemetry HTTP and Logs Data Model conventions. Review #749, #637, #759, and #760 to understand the related logging work. Done means the field mapping and default-versus-opt-in format are agreed with maintainers and implemented consistently.

索引モデルが issue の本文から書いたものです。

説明

enhancement v3
Search for duplicate feature request
  • I already searched, and this feature request or improvement is not a duplicate.
Feature scope

Improve existing functionality

Feature request related to a problem

We run SWS behind a CDN and ship its logs to an OpenTelemetry pipeline (collector filelog receiver → a log backend). v3's JSON format (--log-format json) is a big step forward, but its field names are SWS-specific, so every deployment that feeds an OpenTelemetry (or ECS/Loki/Datadog-style) backend has to maintain its own rename/parse rules:

{"timestamp":"…","level":"INFO","message":"incoming request","method":"GET","uri":"/missing.css","remote_addr":"::ffff:192.168.65.1","target":"static_web_server::log_addr"}
{"timestamp":"…","level":"WARN","method":"GET","uri":"/missing.css","status":404,"error":"Not Found","target":"static_web_server::error_page"}

The maintainer noted in #735 that v3 has more freedom to adjust the logging structure. While v3 is still in beta, aligning the JSON field names with the OpenTelemetry semantic conventions would be a one-time, low-cost change that makes SWS logs usable by standard pipelines without per-deployment mapping.

Describe the solution you'd like

In the JSON log format, name the HTTP fields after the OpenTelemetry HTTP semantic conventions (stable):

today OpenTelemetry semconv
method http.request.method
uri url.path (+ url.query when present)
status http.response.status_code
remote_addr client.address (and client.port)
— http.response.body.size, user_agent.original, duration

and keep level as the severity text (already matching the Logs Data Model SeverityText) and timestamp as RFC 3339.

This composes with the in-flight work instead of competing with it:

  • #749 (one response line per request with the status) — that line would carry these fields;
  • #637 (%{token} access log format) — covers users who want nginx/NCSA text; this request is about the default structured JSON;
  • #759 / #760 (opt-in trace_id/span_id from traceparent) — the remaining piece for log↔trace correlation.

If renaming the default is too disruptive even in beta, an opt-in --log-format otel (JSON with semconv names) would work equally well for us.

Describe alternatives you've considered

Renaming fields in the collector (what we do today) works, but every user repeats it, and it breaks silently whenever SWS changes a field. OTLP export from SWS itself would be heavier than needed; semconv-named JSON on stdout/stderr is what collectors already ingest.

Additional context

Happy to help with a PR once the maintainers agree on the shape (rename in beta vs. an opt-in format).

主要言語
Rust
スター
2.4k
フォーク
135
平均マージ
5日 6時間
マージ済み PR(30日)
17

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

static-web-server/static-web-server のほかの issue

static-web-server/static-web-server の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。