Open s4s7 opened 3 months ago
https://github.com/GoogleCloudPlatform/golang-samples/blob/66fabfc8f7e333f244e80e811c0110f4647d1316/profiler/export/main.go#L104
To fill Labels value in matadata.csv
Before:
labelBytes, err := json.Marshal(profile.Labels)
After:
labelBytes, err := json.Marshal(profile.Deployment.Labels)
To make label data more readable:
err = writer.Write([]string{filename, profile.Name, profile.Deployment.Target, profile.Duration.String(), string(labelBytes)})
err = writer.Write([]string{filename, profile.Name, profile.Deployment.Target, profile.Duration.String(), strings.ReplaceAll(string(labelBytes), `"`, ``)})
Labels is always null in my environment.
File,Name,ProfileType,Target,Duration,Labels profiles_1723995611/profile000001.pb.gz,,api,,null profiles_1723995611/profile000002.pb.gz,,api,,null profiles_1723995611/profile000003.pb.gz,,api,,null profiles_1723995611/profile000004.pb.gz,,api,,null profiles_1723995611/profile000005.pb.gz,,api,,null
File,Name,ProfileType,Target,Duration,Labels profiles_1723998663/profile000001.pb.gz,,api,,"{language:go,version:v1.0.6,zone:asia-northeast1-1}" profiles_1723998663/profile000002.pb.gz,,api,,"{language:go,version:v1.0.6,zone:asia-northeast1-1}" profiles_1723998663/profile000003.pb.gz,,api,,"{language:go,version:v1.0.6,zone:asia-northeast1-1}" profiles_1723998663/profile000004.pb.gz,,api,,"{language:go,version:v1.0.6,zone:asia-northeast1-1}" profiles_1723998663/profile000005.pb.gz,,api,,"{language:go,version:v1.0.6,zone:asia-northeast1-1}"
how do you think ?
In which file did you encounter the issue?
https://github.com/GoogleCloudPlatform/golang-samples/blob/66fabfc8f7e333f244e80e811c0110f4647d1316/profiler/export/main.go#L104
Did you change the file? If so, how?
To fill Labels value in matadata.csv
Before:
After:
To make label data more readable:
Before:
After:
Describe the issue
Before: Output results of the metadata.csv
Labels is always null in my environment.
After: Output results of the metadata.csv
how do you think ?