-
Notifications
You must be signed in to change notification settings - Fork 124
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
[Maven Extension] Support Maven Parallel Builds #161
[Maven Extension] Support Maven Parallel Builds #161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, but had a question about a couple of new abstract methods
@@ -134,7 +148,9 @@ public static MavenProjectKey fromMavenProject(@Nonnull MavenProject mavenProjec | |||
|
|||
abstract String pluginArtifactId(); | |||
|
|||
static MojoExecutionKey fromMojoExecution(MojoExecution mojoExecution) { | |||
abstract MavenProjectKey projectKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is projectKey()
used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used by the Map of spans by mojoExecutionKey
of the SpanRegistry. It's needed when using Maven Parallel Builds as the same mojo goal can be executed simultaneously on multiple Maven sub projects.
@@ -114,9 +126,11 @@ public Span removeSpan(MojoExecution mojoExecution) { | |||
|
|||
abstract String artifactId(); | |||
|
|||
public static MavenProjectKey fromMavenProject(@Nonnull MavenProject mavenProject) { | |||
abstract String version(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is version()
used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a protection for the map of spans by MojoExecutionKeys. I imagine 2 mojo executions can't execute simultaneously on the same project with the different version of the Maven plugin but I felt it's a safe guardrail.
@trask Is there a problem with the |
ya, the problem is that:
I'm not sure what the best workaround is. For now I have given everyone in |
@@ -38,6 +42,7 @@ public void setRootSpan(Span rootSpan) { | |||
} | |||
|
|||
public Span getSpan(MavenProject mavenProject) { | |||
logger.debug("OpenTelemetry: getSpan({}, {})", mavenProject, Thread.currentThread()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have Thread.currentThread
in logging messages - most loggers will output the thread info if configured in the pattern anyways.
If we do have it we to check if debug level is enabled before calling the not trivially cheap method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description:
Support Maven Parallel Builds.
Existing Issue(s):
Testing:
Test the following build with the modified opentelemetry-maven-extension
Documentation:
No change needed
Outstanding items:
None