Skip to content

Conversation

@cqhasy
Copy link
Contributor

@cqhasy cqhasy commented Aug 14, 2025

No description provided.

@mrproliu mrproliu self-requested a review August 14, 2025 02:40
@mrproliu mrproliu added the enhancement New feature or request label Aug 14, 2025
@mrproliu mrproliu added this to the 0.7.0 milestone Aug 14, 2025
go.mod Outdated
module github.com/apache/skywalking-go

go 1.19
go 1.24
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does the agent need to update to 1.24? The user may use the older go version and it will break the user dependency.

go.mod Outdated
toolchain go1.24.4

replace (
skywalking.apache.org/repo/goapi => ../skywalking-goapi
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the goapi back to the original version.

skywalking.apache.org/repo/goapi => ../skywalking-goapi
)

require (
Copy link
Contributor

Choose a reason for hiding this comment

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

This feature no needs to update the dependency, please roll back. Only goapi should be updated.

if err != nil {
return nil, err
}
//id := span.(AdaptSpan).GetTraceID()
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the comment line.

}

id := span.TraceID()
fmt.Println("trace_id:", id)
Copy link
Contributor

Choose a reason for hiding this comment

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

The fmt.Println should be remove.

const grpcReporterInitFunc = `
func initGRPCReporter(logger operator.LogOperator,
checkInterval time.Duration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep the original format.

@cqhasy cqhasy closed this Sep 20, 2025
@cqhasy cqhasy reopened this Sep 21, 2025

on:
pull_request:
push:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep this only trigger on the pull request to reduce the CI resource.


on:
push:
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rollback this change.

p := runtimeGetProfLabel()
if p != nil {
version := runtime.Version()
if version < "go1.20" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you compare the Go version as a string? It should be an int type?


type ProfileOperator interface {
GetPprofLabelSet(traceID string, segmentID string, spanID int32) interface{}
TurnToPprofLabel(l interface{}) interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simplify the profile operator? We should only set and get the trace info from the goroutine is enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like these two methods are only invoked by one place. Can we combine them to one method? And could you explain what these are to the methods work for?


func (i *Instrument) FilterAndEdit(path string, curFile *dst.File, cursor *dstutil.Cursor, allFiles []*dst.File) bool {
// skip stdlib/module cache
if i.opts != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you want to enhance a lot of packages? why you needs to do this?

if _, exists := m.TraceProfileTasks[task.TaskID]; exists {
return
}
endTime := task.StartTime + int64(task.Duration)*60*1000
Copy link
Contributor

Choose a reason for hiding this comment

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

Please using time.Time#Add to add duration.

m.Log.Errorf("profile event error:%v", err)
return
}
t := m.TraceProfileTasks[m.currentTask.taskID]
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, this map will only have one data, so there's no need to use the map, right?

type TaskStatus int

const (
Pending TaskStatus = iota
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this status only work for the trace profiling task? Please add the prefix of the const. In case it conflicts with other concepts.

defer ticker.Stop()

go func() {
for range ticker.C {
Copy link
Contributor

Choose a reason for hiding this comment

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

If the task has started, and after one second, the endpoint does not trigger any request. The agent will stop the profiling without reaching the end time? This logic may not be correct.
Also, if the end time is not reached, and you have stopped the profiling, at this time, the agent receives the request that matches the endpoint. Will it restart the profiling?
So I think for the simplify, you could just stop the profiling when the end time reached.

@cqhasy cqhasy closed this Sep 26, 2025
@cqhasy cqhasy reopened this Sep 26, 2025
@cqhasy cqhasy closed this Sep 28, 2025
@cqhasy cqhasy reopened this Sep 29, 2025

on:
pull_request:
puLL_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rollback to the original one.

go.work Outdated
./test/plugins/scenarios/logrus
./test/plugins/scenarios/zap
./test/plugins/scenarios/mux
./plugins/pprof
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the locate same with other plugins.


type ProfileOperator interface {
GetPprofLabelSet(traceID string, segmentID string, spanID int32) interface{}
TurnToPprofLabel(l interface{}) interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like these two methods are only invoked by one place. Can we combine them to one method? And could you explain what these are to the methods work for?

@mrproliu mrproliu merged commit a424bfc into apache:main Oct 17, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants