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

CloudProfiler: Labels is always null in matadata.csv #4323

Open
s4s7 opened this issue Aug 18, 2024 · 0 comments
Open

CloudProfiler: Labels is always null in matadata.csv #4323

s4s7 opened this issue Aug 18, 2024 · 0 comments
Labels
api: cloudprofiler Issues related to the Cloud Profiler API. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@s4s7
Copy link

s4s7 commented Aug 18, 2024

In which file did you encounter the issue?

labelBytes, err := json.Marshal(profile.Labels)

Did you change the file? If so, how?

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:

Before:

err = writer.Write([]string{filename, profile.Name, profile.Deployment.Target, profile.Duration.String(), string(labelBytes)})

After:

err = writer.Write([]string{filename, profile.Name, profile.Deployment.Target, profile.Duration.String(), strings.ReplaceAll(string(labelBytes), `"`, ``)})

Describe the issue

Before: Output results of the metadata.csv

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

After: Output results of the metadata.csv

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 ?

@s4s7 s4s7 added priority: p2 Moderately-important priority. Fix may not be included in next release. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 18, 2024
@product-auto-label product-auto-label bot added api: cloudprofiler Issues related to the Cloud Profiler API. samples Issues that are directly related to samples. labels Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: cloudprofiler Issues related to the Cloud Profiler API. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant