Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Be able to set an agent log format with a configuration option

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

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
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
observability

Hướng nghiên cứu

Bắt đầu với agent/src/main/java/io/pyroscope/javaagent/PyroscopeAgent.java và agent/src/main/java/io/pyroscope/javaagent/api/Logger.java, các entry point được liên kết trong issue. Truy vết cách agent logger được khởi tạo và xem xét cấu hình PYROSCOPE_LOG_LEVEL hiện có. Công việc được xem là hoàn tất khi agent cung cấp tùy chọn log-format được yêu cầu và tạo đầu ra theo định dạng đã chọn, với độ bao phủ cho các định dạng được hỗ trợ.

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

Mô tả

Our scenario

Hello. We are using docker as the underlying technology to deploy apps and the observability stack. For all the logs we decide to use JSON format that is sent to our Loki backend.
We are trying to adopt the pyroscope Java Otel extension (that implicitly has the Java Agent) to send profiling data to our Pyroscope server.

The issue

During our testing, when we are sending the Pyroscope backend server down, all Java apps using the extension are producing lot of logs that don't align with the rest of echosystem. In our case is JSON.
This is the kind of output we are getting from the agent logger in the docker console:

2024-03-21 11:37:15.292 [ERROR] Error uploading snapshot: 502 <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

Currently the agent only has this log parameter PYROSCOPE_LOG_LEVEL which is not enough for this case.

Possible solutions
  • As discussed in this thread a custom logger interface implementation can be done:

https://github.com/grafana/pyroscope-java/blob/f73ebfaae1fcdfdf61d3418a78807c5b2b0[…]/agent/src/main/java/io/pyroscope/javaagent/PyroscopeAgent.java
https://github.com/grafana/pyroscope-java/blob/82b1daba0dc05b1851e6b96f2d760ab7901[…]0c49/agent/src/main/java/io/pyroscope/javaagent/api/Logger.java

However, that would require initializing the profiler outside the otel extension, and this is not available when it's running as a javagent.

  • Add a flag PYROSCOPE_LOG_FORMAT to set the logger format. it could be JSON or LOGFTM to align with rest of Grafana stack.
Ngôn ngữ chính
Java
Star
125
Fork
48
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 grafana/pyroscope-java

Tất cả issue của grafana/pyroscope-java

Issue tương tự

Thêm issue về Java

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.