[
https://issues.apache.org/jira/browse/BEAM-12045?focusedWorklogId=588048&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-588048
]
ASF GitHub Bot logged work on BEAM-12045:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Apr/21 18:27
Start Date: 23/Apr/21 18:27
Worklog Time Spent: 10m
Work Description: emilymye commented on a change in pull request #14598:
URL: https://github.com/apache/beam/pull/14598#discussion_r619403632
##########
File path: sdks/java/container/boot.go
##########
@@ -148,9 +149,20 @@ func main() {
"-Xmx" + strconv.FormatUint(heapSizeLimit(info), 10),
"-XX:-OmitStackTraceInFastThrow",
"-cp", strings.Join(cp, ":"),
- "org.apache.beam.fn.harness.FnHarness",
}
+ enable_google_cloud_profiler := strings.Contains(options,
"enable_google_cloud_profiler")
+ if enable_google_cloud_profiler {
+ if metadata := info.GetMetadata(); metadata != nil {
+ if jobName, nameExists := metadata["job_name"];
nameExists {
+ if jobId, idExists := metadata["job_id"];
idExists {
+ args = append(args,
fmt.Sprintf("-agentpath:/opt/google_cloud_profiler/profiler_java_agent.so=-cprof_service=%v,-cprof_service_version=%v",
jobName, jobId))
Review comment:
I think I would prefer string %s over default %v formatting.
##########
File path: sdks/java/container/boot.go
##########
@@ -148,9 +149,20 @@ func main() {
"-Xmx" + strconv.FormatUint(heapSizeLimit(info), 10),
"-XX:-OmitStackTraceInFastThrow",
"-cp", strings.Join(cp, ":"),
- "org.apache.beam.fn.harness.FnHarness",
}
+ enable_google_cloud_profiler := strings.Contains(options,
"enable_google_cloud_profiler")
+ if enable_google_cloud_profiler {
+ if metadata := info.GetMetadata(); metadata != nil {
+ if jobName, nameExists := metadata["job_name"];
nameExists {
+ if jobId, idExists := metadata["job_id"];
idExists {
+ args = append(args,
fmt.Sprintf("-agentpath:/opt/google_cloud_profiler/profiler_java_agent.so=-cprof_service=%v,-cprof_service_version=%v",
jobName, jobId))
Review comment:
If we expect that job_name/id are set but they aren't actually in
metadata, should we add a log line for why we don't actually enable cloud
profiling? e.g. "given option enable_google_cloud_profiler but not enabling
because job metadata not found"
##########
File path: sdks/java/container/boot.go
##########
@@ -148,9 +149,20 @@ func main() {
"-Xmx" + strconv.FormatUint(heapSizeLimit(info), 10),
"-XX:-OmitStackTraceInFastThrow",
"-cp", strings.Join(cp, ":"),
- "org.apache.beam.fn.harness.FnHarness",
}
+ enable_google_cloud_profiler := strings.Contains(options,
"enable_google_cloud_profiler")
Review comment:
Camelcase var name for consistency
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 588048)
Time Spent: 5h 10m (was: 5h)
> Add cloud profiler agent to Java SDK harness container
> ------------------------------------------------------
>
> Key: BEAM-12045
> URL: https://issues.apache.org/jira/browse/BEAM-12045
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-harness
> Reporter: Yichi Zhang
> Priority: P2
> Time Spent: 5h 10m
> Remaining Estimate: 0h
>
> To enable profiling through Google Cloud Profiler for java pipelines on
> dataflow runner v2, we'll need to install the cloud profiler agent into the
> Java SDK harness container, and set up pipeline options for enabling the
> profiling.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)