feat(telemetry): extend OTel log bridge to cover user application loggers

Đang mở
#1,211 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
40/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
observability

Hướng nghiên cứu

Start by finding where Mellea attaches its OTLP log handler to the mellea.* logger hierarchy, and check how the MELLEA_LOGS_OTLP environment variable turns it on. Work out whether the handler can move to the root logger or be made configurable without duplicating records. Done means a record from a user's logging.getLogger(__name__) reaches the OTLP exporter with its trace and span IDs when MELLEA_LOGS_OTLP=true. The issue has no comments yet, so confirm the approach with maintainers before implementing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/telemetry enhancement p2

Mellea's OTel log bridge forwards only mellea-internal loggers to the OTLP log exporter. Log lines emitted by user application code via `logging.getLogger(name)` are formatted with `trace_id` / `span_id` on stdout (the OTel trace filter is applied) but are not forwarded to any configured OTLP exporter.

This breaks the "debug this one request" use case that structured logging is meant to enable. An operator sees an interesting span in their trace backend and wants to pivot to the correlated log lines from the application layer — business events, decision points, intermediate results — but those lines never reach the backend.

Observed behaviour (confirmed)

Application log calls such as:

logger = logging.getLogger(__name__)
logger.info("Triage: category=%s urgency=%s", result.category, result.urgency)
logger.info("Draft ready (%d chars)", len(draft_reply))
logger.error("Enrichment service unreachable: %s", exc_type, exc_info=True)

appear on stdout with `trace_id` and `span_id` fields, but do not appear in the OTLP log backend. Only mellea-internal log records (from `mellea.*` loggers) are exported.

Expected behaviour

Any logger in the application's logging hierarchy should have its records forwarded to the OTLP log exporter when `MELLEA_LOGS_OTLP=true`, so that application log lines appear alongside mellea's own internal logs in the backend, all correlated to their trace.

The fix is likely a change to which logger(s) the OTLP log handler is attached — attaching to the root logger (or making the attachment point configurable) would cover all application loggers without requiring any change to user code.

Ngôn ngữ chính
Python
Star
1.8k
Fork
161
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của generative-computing/mellea

Tất cả issue của generative-computing/mellea

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.