Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#147 1 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
observability

调研方向

从 agent/src/main/java/io/pyroscope/javaagent/PyroscopeAgent.java 和 agent/src/main/java/io/pyroscope/javaagent/api/Logger.java 开始,这些是 issue 中链接的入口点。跟踪 agent logger 的初始化方式,并检查现有的 PYROSCOPE_LOG_LEVEL 配置。完成标准是 agent 提供所请求的日志格式选项,并以所选格式生成输出,同时覆盖受支持的格式。

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
Java
星标
125
派生
48
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

grafana/pyroscope-java 的其他 Issue

查看 grafana/pyroscope-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。