This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use TracingFactory to consolidate constructors
Signed-off-by: Isaac Hier <ihier@uber.com>
- Loading branch information
Isaac Hier
committed
Aug 7, 2018
1 parent
750d448
commit 848881a
Showing
8 changed files
with
246 additions
and
118 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
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
76 changes: 76 additions & 0 deletions
76
jaeger-core/src/main/java/io/jaegertracing/internal/TracingFactory.java
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,76 @@ | ||
package io.jaegertracing.internal; | ||
|
||
import io.jaegertracing.internal.clock.Clock; | ||
import io.jaegertracing.internal.metrics.Metrics; | ||
import io.jaegertracing.spi.BaggageRestrictionManager; | ||
import io.jaegertracing.spi.Reporter; | ||
import io.jaegertracing.spi.Sampler; | ||
import io.opentracing.ScopeManager; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class TracingFactory { | ||
public JaegerTracer createTracer( | ||
String serviceName, | ||
Reporter reporter, | ||
Sampler sampler, | ||
PropagationRegistry registry, | ||
Clock clock, | ||
Metrics metrics, | ||
Map<String, Object> tags, | ||
boolean zipkinSharedRpcSpan, | ||
ScopeManager scopeManager, | ||
BaggageRestrictionManager baggageRestrictionManager, | ||
boolean expandExceptionLogs) { | ||
return new JaegerTracer( | ||
serviceName, | ||
reporter, | ||
sampler, | ||
registry, | ||
clock, | ||
metrics, | ||
tags, | ||
zipkinSharedRpcSpan, | ||
scopeManager, | ||
baggageRestrictionManager, | ||
expandExceptionLogs); | ||
} | ||
|
||
public JaegerSpan createSpan( | ||
JaegerTracer tracer, | ||
String operationName, | ||
JaegerSpanContext context, | ||
long startTimeMicroseconds, | ||
long startTimeNanoTicks, | ||
boolean computeDurationViaNanoTicks, | ||
Map<String, Object> tags, | ||
List<Reference> references) { | ||
return new JaegerSpan( | ||
tracer, | ||
operationName, | ||
context, | ||
startTimeMicroseconds, | ||
startTimeNanoTicks, | ||
computeDurationViaNanoTicks, | ||
tags, | ||
references); | ||
} | ||
|
||
public JaegerSpanContext createSpanContext(long traceId, | ||
long spanId, | ||
long parentId, | ||
byte flags, | ||
Map<String, String> baggage, | ||
String debugId) { | ||
return new JaegerSpanContext(traceId, spanId, parentId, flags, baggage, debugId); | ||
} | ||
|
||
public JaegerTracer.SpanBuilder createSpanBuilder(JaegerTracer tracer, String operationName) { | ||
return tracer.new SpanBuilder(operationName); | ||
} | ||
|
||
public JaegerTracer.Builder createTracerBuilder(String serviceName) { | ||
return new JaegerTracer.Builder(serviceName); | ||
} | ||
} |
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
Oops, something went wrong.