Skip to content

Commit 61b2ee4

Browse files
committed
ocjdbc talk added
1 parent 1af80fc commit 61b2ee4

24 files changed

+2585
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
java.sql.Connection conn = new Connection(originalConn,
2+
// And passing this option to allow the spans
3+
// to be annotated with the SQL queries.
4+
// Please note that this could be a security concern
5+
// since it could reveal personally identifying information.
6+
Observability.OPTION_ANNOTATE_TRACES_WITH_SQL);

2018/10/22/ocjdbc/exporters.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import io.opencensus.exporter.trace.jaeger.JaegerTraceExporter;
2+
import io.opencensus.exporter.stats.prometheus.PrometheusStatsCollector;
3+
import io.prometheus.client.exporter.HTTPServer;
4+
5+
public static void enableObservability() throws Exception {
6+
Observability.registerAllViews();
7+
8+
// The trace exporter, for this demo we'll use Zipkin.
9+
JaegerTraceExporter.createAndRegister("http://127.0.0.1:14268/api/traces", "ocjdbc-demo");
10+
11+
// The metrics exporter.
12+
PrometheusStatsCollector.createAndRegister();
13+
14+
// Run the server as a daeon on address "localhost:8889".
15+
HTTPServer server = new HTTPServer("localhost", 8889);
16+
}

2018/10/22/ocjdbc/import.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import io.opencensus.integration.ocjdbc.Connection;
2+
import io.opencensus.integration.ocjdbc.Observability;
3+
4+
public static void main(String ...args) {
5+
// After you've enabled your connection, we'll now wrap it
6+
java.sql.Connection conn = new Connection(originalConn);
7+
8+
// Continue using your connection like you did in your normal programs
9+
}
10+
11+
public static void enableObservability() {
12+
// Enable observability with OpenCensus
13+
Observability.registerAllViews();
14+
15+
// Now create the trace and metrics exporters
16+
}

2018/10/22/ocjdbc/maven.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<dependency>
2+
<groupId>io.opencensus.integration</groupId>
3+
<artifactId>opencensus-ocjdbc</artifactId>
4+
<version>0.2.0</version>
5+
</dependency>
64 KB
Loading
148 KB
Loading
1.27 MB
Loading
417 KB
Loading
342 KB
Loading
345 KB
Loading

0 commit comments

Comments
 (0)