Skip to content

Commit

Permalink
Polished the code
Browse files Browse the repository at this point in the history
  • Loading branch information
marcingrzejszczak committed Aug 29, 2023
1 parent bddf5f7 commit 5e68181
Show file tree
Hide file tree
Showing 13 changed files with 1,073 additions and 2 deletions.
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@
<artifactId>zipkin-reporter-metrics-micrometer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>zipkin-reporter-brave-otlp</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016-2020 The OpenZipkin Authors
Copyright 2016-2023 The OpenZipkin Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
Expand Down
42 changes: 42 additions & 0 deletions otlp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# zipkin-otlp-reporter-brave
This allows you to send spans recorded by Brave 5.12+ with a OTLP reporter.

To start sending the spans you would need to use GRPC in the following way:

```xml
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>${grpc.version}</version>
</dependency>
```

and then set up the `Reporter` and `SpanHandler` like this

```java

SpanHandler otlpSpanHandler = OtlpSpanHandler
.create(OtlpReporter.create(ManagedChannelBuilder.forAddress("localhost", 4317)
// For demo purposes we disable security
.usePlaintext()));

Tracing tracing = Tracing.newBuilder()
.currentTraceContext(braveCurrentTraceContext)
.supportsJoin(false)
.traceId128Bit(true)
.sampler(Sampler.ALWAYS_SAMPLE)
// Add the SpanHandler
.addSpanHandler(otlpSpanHandler)
.localServiceName("my-service")
.build();
```
2 changes: 2 additions & 0 deletions otlp/bnd.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Export-Package: \
zipkin2.reporter.otlp
Loading

0 comments on commit 5e68181

Please sign in to comment.