Skip to content
New issue

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

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

Already on GitHub? # to your account

add-http_response 添加trace数据 #1133

Merged
merged 2 commits into from
Jan 20, 2025
Merged

Conversation

fedocx
Copy link
Contributor

@fedocx fedocx commented Jan 10, 2025

var labels map[string]string
if ins.Trace != nil && *ins.Trace {
traceid := uuid.New().String()
labels = map[string]string{"target": target, "traceid": traceid}
Copy link
Collaborator

@kongfei605 kongfei605 Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

traceid不建议添加到label,对于时序指标来说不是稳态

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主要考虑是将同一个请求通过traceid给关联到一起,至于稳态不太理解。能否解释下。

Copy link
Collaborator

@kongfei605 kongfei605 Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

比如每10秒拨测一次。 这样这个十秒和下一个十秒的指标 label不同,这样的指标会造成tsdb的存储压力

// request
DNSDone: func(info httptrace.DNSDoneInfo) {
dns_time = time.Now()
fields["dns_time"] = time.Since(start).Seconds()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

时间可以都修改为按照毫秒

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个插件原有指标也可以修改为毫秒吗,如http_response_response_time

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以改,为了兼容老的用户告警,最好新增一个 xxx_time_ms 指标

@fedocx
Copy link
Contributor Author

fedocx commented Jan 20, 2025

已重新提交

@kongfei605 kongfei605 merged commit f503c7d into flashcatcloud:main Jan 20, 2025
2 of 3 checks passed
@kongfei605
Copy link
Collaborator

Thank you @fedocx

@kongfei605
Copy link
Collaborator

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants