-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break circular dependency when zipkin tracing is enabled (#1049)
* Break circular dependency when zipkin tracing is enabled * Update gcp-tracing/src/test/resources/logback.xml * Update gcp-tracing/src/test/groovy/io/micronaut/gcp/tracing/zipkin/StackdriverConfigurationSpec.groovy --------- Co-authored-by: Sergio del Amo <[email protected]>
- Loading branch information
1 parent
705b91b
commit 0470d3d
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...acing/src/test/groovy/io/micronaut/gcp/tracing/zipkin/StackdriverConfigurationSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.micronaut.gcp.tracing.zipkin | ||
|
||
import io.micronaut.context.ApplicationContext | ||
import io.micronaut.gcp.credentials.GoogleCredentialsConfiguration | ||
import io.micronaut.gcp.credentials.fixture.ServiceAccountCredentialsTestHelper | ||
import spock.lang.Issue | ||
import spock.lang.Specification | ||
import zipkin2.reporter.Sender | ||
|
||
import java.security.PrivateKey | ||
|
||
class StackdriverConfigurationSpec extends Specification { | ||
|
||
@Issue("https://github.com/micronaut-projects/micronaut-gcp/issues/1045") | ||
void "application starts successfully with stackdriver and zipkin enabled"() { | ||
given: | ||
PrivateKey pk = ServiceAccountCredentialsTestHelper.generatePrivateKey() | ||
File serviceAccountCredentials = ServiceAccountCredentialsTestHelper.writeServiceCredentialsToTempFile(pk) | ||
ApplicationContext ctx = ApplicationContext.run([ | ||
"gcp.project-id" : "test-project", | ||
(GoogleCredentialsConfiguration.PREFIX + ".location"): serviceAccountCredentials.getPath(), | ||
"tracing.zipkin.enabled": true | ||
]) | ||
|
||
when: | ||
Sender sender = ctx.getBean(Sender.class) | ||
|
||
then: | ||
noExceptionThrown() | ||
sender | ||
|
||
cleanup: | ||
ctx.close() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<configuration> | ||
|
||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="info"> | ||
<appender-ref ref="STDOUT" /> | ||
</root> | ||
|
||
</configuration> |