-
Notifications
You must be signed in to change notification settings - Fork 53
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
Use OpenTelemetry Shim with Lightstep launcher #21
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
package com.otsample.api; | ||
|
||
import brave.opentracing.BraveTracer; | ||
import com.lightstep.opentelemetry.launcher.OpenTelemetryConfiguration; | ||
import io.jaegertracing.internal.samplers.ConstSampler; | ||
import io.opentelemetry.opentracingshim.TraceShim; | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.net.MalformedURLException; | ||
|
@@ -11,16 +15,11 @@ | |
import org.eclipse.jetty.server.handler.ContextHandlerCollection; | ||
import org.eclipse.jetty.server.handler.ResourceHandler; | ||
|
||
import com.lightstep.tracer.jre.JRETracer; | ||
import com.lightstep.tracer.shared.Options; | ||
|
||
import brave.Tracing; | ||
import brave.opentracing.BraveTracer; | ||
import io.jaegertracing.Configuration; | ||
import io.jaegertracing.Configuration.ReporterConfiguration; | ||
import io.jaegertracing.Configuration.SamplerConfiguration; | ||
import io.jaegertracing.Configuration.SenderConfiguration; | ||
import io.jaegertracing.samplers.ConstSampler; | ||
import io.opentracing.Tracer; | ||
import io.opentracing.util.GlobalTracer; | ||
import zipkin2.Span; | ||
|
@@ -100,17 +99,17 @@ static boolean configureGlobalTracer(Properties config, String componentName) | |
.spanReporter(reporter) | ||
.build()); | ||
} else if ("lightstep".equals(tracerName)) { | ||
Options opts = new Options.OptionsBuilder() | ||
.withAccessToken(config.getProperty("lightstep.access_token")) | ||
.withCollectorHost(config.getProperty("lightstep.collector_host")) | ||
.withCollectorPort(Integer.decode(config.getProperty("lightstep.collector_port"))) | ||
.withComponentName(componentName) | ||
.build(); | ||
tracer = new JRETracer(opts); | ||
OpenTelemetryConfiguration.newBuilder() | ||
.setServiceName(componentName) | ||
.setAccessToken(config.getProperty("lightstep.access_token")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to directly use the new system property names, e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated to use system properties |
||
.setSpanEndpoint(config.getProperty("lightstep.collector_host")) | ||
.install(); | ||
|
||
tracer = TraceShim.createTracerShim(); | ||
} else { | ||
return false; | ||
} | ||
GlobalTracer.register(tracer); | ||
GlobalTracer.registerIfAbsent(tracer); | ||
return true; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this version still accessible/download-able? Else, we should probably wait for the 0.7.0 release of the agent (and related components).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's better to wait for 0.7.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated version to 0.7.0