Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Commit d5db07d

Browse files
authored
Examples: Uncomment OcAgentExportersQuickStart. (#1826)
1 parent 7418753 commit d5db07d

2 files changed

Lines changed: 35 additions & 36 deletions

File tree

examples/build.gradle

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ dependencies {
5151
"io.opencensus:opencensus-contrib-http-util:${opencensusVersion}",
5252
"io.opencensus:opencensus-contrib-http-servlet:${opencensusVersion}",
5353
"io.opencensus:opencensus-contrib-http-jetty-client:${opencensusVersion}",
54-
// "io.opencensus:opencensus-exporter-metrics-ocagent:${opencensusVersion}",
54+
"io.opencensus:opencensus-exporter-metrics-ocagent:${opencensusVersion}",
5555
"io.opencensus:opencensus-exporter-stats-prometheus:${opencensusVersion}",
5656
"io.opencensus:opencensus-exporter-stats-stackdriver:${opencensusVersion}",
5757
"io.opencensus:opencensus-exporter-trace-jaeger:${opencensusVersion}",
5858
"io.opencensus:opencensus-exporter-trace-stackdriver:${opencensusVersion}",
5959
"io.opencensus:opencensus-exporter-trace-logging:${opencensusVersion}",
60-
// "io.opencensus:opencensus-exporter-trace-ocagent:${opencensusVersion}",
60+
"io.opencensus:opencensus-exporter-trace-ocagent:${opencensusVersion}",
6161
"io.grpc:grpc-protobuf:${grpcVersion}",
6262
"io.grpc:grpc-stub:${grpcVersion}",
6363
"io.grpc:grpc-netty-shaded:${grpcVersion}",
@@ -105,7 +105,6 @@ sourceSets {
105105
main {
106106
java {
107107
srcDir 'src'
108-
exclude { FileTreeElement e -> e.path.contains('ocagent/') }
109108
srcDirs 'build/generated/source/proto/main/grpc'
110109
srcDirs 'build/generated/source/proto/main/java'
111110
}
@@ -240,13 +239,12 @@ task httpJettyClient(type: CreateStartScripts) {
240239
classpath = jar.outputs.files + project.configurations.runtime
241240
}
242241

243-
// TODO(songy23): uncomment this when Agent exporters are released.
244-
//task ocAgentExportersQuickStart(type: CreateStartScripts) {
245-
// mainClassName = 'io.opencensus.examples.ocagent.OcAgentExportersQuickStart'
246-
// applicationName = 'OcAgentExportersQuickStart'
247-
// outputDir = new File(project.buildDir, 'tmp')
248-
// classpath = jar.outputs.files + project.configurations.runtime
249-
//}
242+
task ocAgentExportersQuickStart(type: CreateStartScripts) {
243+
mainClassName = 'io.opencensus.examples.ocagent.OcAgentExportersQuickStart'
244+
applicationName = 'OcAgentExportersQuickStart'
245+
outputDir = new File(project.buildDir, 'tmp')
246+
classpath = jar.outputs.files + project.configurations.runtime
247+
}
250248

251249

252250
applicationDistribution.into('bin') {
@@ -266,6 +264,6 @@ applicationDistribution.into('bin') {
266264
from(longGaugeQuickstart)
267265
from(httpJettyServer)
268266
from(httpJettyClient)
269-
// from(ocAgentExportersQuickStart)
267+
from(ocAgentExportersQuickStart)
270268
fileMode = 0755
271269
}

examples/pom.xml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<!-- change to the version you want to use. -->
1414
<jetty.version>9.4.12.v20180830</jetty.version>
1515
<opencensus.version>0.20.0</opencensus.version><!-- LATEST_OPENCENSUS_RELEASE_VERSION -->
16-
<grpc.version>1.17.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
16+
<grpc.version>1.19.0</grpc.version><!-- CURRENT_GRPC_VERSION -->
1717
</properties>
1818
<dependencies>
1919
<dependency>
@@ -46,15 +46,21 @@
4646
<artifactId>opencensus-contrib-zpages</artifactId>
4747
<version>${opencensus.version}</version>
4848
</dependency>
49-
<!--<dependency>-->
50-
<!--<groupId>io.opencensus</groupId>-->
51-
<!--<artifactId>opencensus-exporter-metrics-ocagent</artifactId>-->
52-
<!--<version>${opencensus.version}</version>-->
53-
<!--</dependency>-->
49+
<dependency>
50+
<groupId>io.opencensus</groupId>
51+
<artifactId>opencensus-exporter-metrics-ocagent</artifactId>
52+
<version>${opencensus.version}</version>
53+
</dependency>
5454
<dependency>
5555
<groupId>io.opencensus</groupId>
5656
<artifactId>opencensus-exporter-stats-stackdriver</artifactId>
5757
<version>${opencensus.version}</version>
58+
<exclusions>
59+
<exclusion>
60+
<groupId>io.grpc</groupId>
61+
<artifactId>grpc-core</artifactId>
62+
</exclusion>
63+
</exclusions>
5864
</dependency>
5965
<dependency>
6066
<groupId>io.opencensus</groupId>
@@ -76,16 +82,21 @@
7682
<artifactId>opencensus-exporter-trace-logging</artifactId>
7783
<version>${opencensus.version}</version>
7884
</dependency>
79-
<!--<dependency>-->
80-
<!--<groupId>io.opencensus</groupId>-->
81-
<!--<artifactId>opencensus-exporter-trace-ocagent</artifactId>-->
82-
<!--<version>${opencensus.version}</version>-->
83-
<!--</dependency>-->
85+
<dependency>
86+
<groupId>io.opencensus</groupId>
87+
<artifactId>opencensus-exporter-trace-ocagent</artifactId>
88+
<version>${opencensus.version}</version>
89+
</dependency>
8490
<dependency>
8591
<groupId>io.grpc</groupId>
8692
<artifactId>grpc-core</artifactId>
8793
<version>${grpc.version}</version>
8894
</dependency>
95+
<dependency>
96+
<groupId>io.grpc</groupId>
97+
<artifactId>grpc-netty</artifactId>
98+
<version>${grpc.version}</version>
99+
</dependency>
89100
<dependency>
90101
<groupId>io.grpc</groupId>
91102
<artifactId>grpc-netty-shaded</artifactId>
@@ -236,11 +247,10 @@
236247
<id>HttpJettyServer</id>
237248
<mainClass>io.opencensus.examples.http.jetty.server.HelloWorldServer</mainClass>
238249
</program>
239-
<!--TODO(songy23): uncomment this when Agent exporters are released.-->
240-
<!--<program>-->
241-
<!--<id>OcAgentExportersQuickStart</id>-->
242-
<!--<mainClass>io.opencensus.examples.ocagent.OcAgentExportersQuickStart</mainClass>-->
243-
<!--</program>-->
250+
<program>
251+
<id>OcAgentExportersQuickStart</id>
252+
<mainClass>io.opencensus.examples.ocagent.OcAgentExportersQuickStart</mainClass>
253+
</program>
244254
</programs>
245255
</configuration>
246256
</plugin>
@@ -265,15 +275,6 @@
265275
</execution>
266276
</executions>
267277
</plugin>
268-
<plugin>
269-
<groupId>org.apache.maven.plugins</groupId>
270-
<artifactId>maven-compiler-plugin</artifactId>
271-
<configuration>
272-
<excludes>
273-
<exclude>**/ocagent/**/*.java</exclude>
274-
</excludes>
275-
</configuration>
276-
</plugin>
277278
</plugins>
278279
</build>
279280
</project>

0 commit comments

Comments
 (0)