Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] opentelemetry error stack setting field #3182

Closed
shuqingzai opened this issue Nov 30, 2023 · 3 comments
Closed

[BUG] opentelemetry error stack setting field #3182

shuqingzai opened this issue Nov 30, 2023 · 3 comments

Comments

@shuqingzai
Copy link

shuqingzai commented Nov 30, 2023

在 HTTP 服务请求异常时,上报 opentelemetry ,异常描述直接设置为错误堆栈,导致描述信息包含所有堆栈信息,内容过长,无法提取异常提示语,应该将描述与堆栈信息分开,采用 opentelemetry 中的 ExceptionStacktraceKey 表示堆栈信息

参考:

	// Error logging.
	if err = r.GetError(); err != nil {
		span.SetStatus(codes.Error, err.Error()))
                 // 添加堆栈
                span.SetAttributes(semconv.ExceptionStacktraceKey.String(fmt.Sprintf(`%+v`, err)))
	}

1. What version of Go and system type/arch are you using?

# -> % go version
go version go1.21.4 darwin/amd64

2. What version of GoFrame are you using?

# -> % gf version
v2.5.7
Welcome to GoFrame!
Env Detail:
  Go Version: go1.21.4 darwin/amd64
  GF Version(go.mod):
    github.com/gogf/gf/[email protected]
CLI Detail:
  Installed At: /Code/go/bin/gf
  Built Go Version: go1.21.4
  Built GF Version: v2.5.7
Others Detail:
  Docs: https://goframe.org
  Now : 2023-11-27T18:26:37+08:00

3. Can this issue be re-produced with the latest release?

是的

4. What did you do?

5. What did you expect to see?

6. What did you see instead?

@Issues-translate-bot Issues-translate-bot changed the title [BUG] opentelemetry 错误堆栈设置字段 [BUG] opentelemetry error stack setting field Nov 30, 2023
@houseme
Copy link
Member

houseme commented Dec 11, 2023

欢迎提pr改进

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Welcome to suggest improvements

Copy link

Hello @shuqingzai. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @shuqingzai。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants