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

Initial Request Tracing Implementation #1093

Merged
merged 6 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions genie-agent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ dependencies {
*******************************/

implementation("io.grpc:grpc-netty")
implementation("io.zipkin.brave:brave")
implementation("io.zipkin.brave:brave-instrumentation-grpc")
implementation("org.apache.commons:commons-lang3")
implementation("org.hibernate.validator:hibernate-validator")
implementation("org.slf4j:slf4j-api")
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-log4j2")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.cloud:spring-cloud-starter-aws")
implementation("org.springframework.cloud:spring-cloud-starter-sleuth")

/*******************************
* Compile Only Dependencies
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package com.netflix.genie.agent.cli;

/**
* Interface for argument classes used by {@ref ArgumentParser}.
* Interface for argument classes used by {@link ArgumentParser}.
*
* @author mprimi
* @since 4.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.netflix.genie.agent.execution.services.KillService;
import com.netflix.genie.agent.execution.statemachine.JobExecutionStateMachine;
import com.netflix.genie.agent.properties.AgentProperties;
import com.netflix.genie.common.internal.tracing.brave.BraveTracingComponents;
import com.netflix.genie.proto.PingServiceGrpc;
import org.apache.logging.log4j.LogManager;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
Expand All @@ -46,17 +47,19 @@
* @since 4.0.0
*/
@Configuration
@EnableConfigurationProperties({
AgentProperties.class
})
@EnableConfigurationProperties(
{
AgentProperties.class
}
)
public class CliAutoConfiguration {
/**
* Provide a bean for cache command line arguments.
*
* @return a {@link CacheArgumentsImpl} instance
*/
@Bean
public ArgumentDelegates.CacheArguments cacheArgumentsDelegate() {
public CacheArgumentsImpl cacheArgumentsDelegate() {
return new CacheArgumentsImpl();
}

Expand Down Expand Up @@ -140,18 +143,20 @@ public ExecCommand execCommand(
* The main {@link GenieAgentRunner} entry point bean which implements
* {@link org.springframework.boot.CommandLineRunner}.
*
* @param argumentParser The argument parser to use
* @param commandFactory The command factory to use
* @param environment The spring environment
* @param argumentParser The argument parser to use
* @param commandFactory The command factory to use
* @param tracingComponents The {@link BraveTracingComponents} to use
* @param environment The spring environment
* @return An instance of {@link GenieAgentRunner} if one hasn't already been provided
*/
@Bean
public GenieAgentRunner genieAgentRunner(
final ArgumentParser argumentParser,
final CommandFactory commandFactory,
final BraveTracingComponents tracingComponents,
final Environment environment
) {
return new GenieAgentRunner(argumentParser, commandFactory, environment);
return new GenieAgentRunner(argumentParser, commandFactory, tracingComponents, environment);
}

/**
Expand Down Expand Up @@ -250,7 +255,7 @@ public MainCommandArguments mainCommandArguments() {
* @return An instance of {@link com.netflix.genie.agent.cli.ArgumentDelegates.JobRequestArguments}
*/
@Bean
public ArgumentDelegates.JobRequestArguments jobRequestArguments(final MainCommandArguments mainCommandArguments) {
public JobRequestArgumentsImpl jobRequestArguments(final MainCommandArguments mainCommandArguments) {
return new JobRequestArgumentsImpl(mainCommandArguments);
}

Expand Down Expand Up @@ -336,7 +341,7 @@ public ResolveJobSpecCommand resolveJobSpecCommand(
* @return A {@link ServerArgumentsImpl} instance
*/
@Bean
public ArgumentDelegates.ServerArguments serverArguments() {
public ServerArgumentsImpl serverArguments() {
return new ServerArgumentsImpl();
}

Expand All @@ -346,7 +351,7 @@ public ArgumentDelegates.ServerArguments serverArguments() {
* @return A {@link CleanupArgumentsImpl} instance
*/
@Bean
public ArgumentDelegates.CleanupArguments cleanupArguments() {
public CleanupArgumentsImpl cleanupArguments() {
return new CleanupArgumentsImpl();
}

Expand All @@ -356,7 +361,7 @@ public ArgumentDelegates.CleanupArguments cleanupArguments() {
* @return A {@link RuntimeConfigurationArgumentsImpl} instance
*/
@Bean
public ArgumentDelegates.RuntimeConfigurationArguments runtimeConfigurationArguments() {
public RuntimeConfigurationArgumentsImpl runtimeConfigurationArguments() {
return new RuntimeConfigurationArgumentsImpl();
}

Expand All @@ -368,7 +373,7 @@ public ArgumentDelegates.RuntimeConfigurationArguments runtimeConfigurationArgum
@Bean
@ConditionalOnClass(name = {"org.apache.logging.log4j.core.LoggerContext"})
@ConditionalOnMissingBean(AgentLogManager.class)
public AgentLogManager agentLogManagerLog4j2() {
public AgentLogManagerLog4j2Impl agentLogManagerLog4j2() {
return new AgentLogManagerLog4j2Impl(
(org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false)
);
Expand Down