Home
last modified time | relevance | path

Searched refs:SpanContext (Results 1 – 25 of 79) sorted by relevance

1234

/external/opencensus-java/contrib/spring_sleuth_v1x/src/main/java/io/opencensus/contrib/spring/sleuth/v1x/
DOpenCensusSleuthSpanContextHolder.java35 private static final ThreadLocal</*@Nullable*/ SpanContext> CURRENT_SPAN =
36 new NamedThreadLocal</*@Nullable*/ SpanContext>("Trace Context");
41 SpanContext currentSpanContext = CURRENT_SPAN.get(); in getCurrentSpan()
61 private static SpanContext removeCurrentSpanInternal( in removeCurrentSpanInternal()
62 @javax.annotation.Nullable SpanContext toRestore) { in removeCurrentSpanInternal()
83 SpanContext current = CURRENT_SPAN.get(); in close()
107 setSpanContextInternal(new SpanContext(span, autoClose)); in push()
121 private static void setSpanContextInternal(SpanContext spanContext) { in setSpanContextInternal()
130 SpanContext currentSpanContext = CURRENT_SPAN.get(); in isCurrent()
134 private static class SpanContext { class in OpenCensusSleuthSpanContextHolder
[all …]
/external/opencensus-java/api/src/main/java/io/opencensus/trace/
DSpanContext.java32 public final class SpanContext { class
44 public static final SpanContext INVALID =
45 new SpanContext(TraceId.INVALID, SpanId.INVALID, TraceOptions.DEFAULT, TRACESTATE_DEFAULT);
57 public static SpanContext create(TraceId traceId, SpanId spanId, TraceOptions traceOptions) { in create()
71 public static SpanContext create( in create()
73 return new SpanContext(traceId, spanId, traceOptions, tracestate); in create()
132 if (!(obj instanceof SpanContext)) { in equals()
136 SpanContext that = (SpanContext) obj; in equals()
158 private SpanContext( in SpanContext() method in SpanContext
/external/opencensus-java/api/src/test/java/io/opencensus/trace/
DSpanContextTest.java37 private static final SpanContext first =
38 SpanContext.create(
43 private static final SpanContext second =
44 SpanContext.create(
52 assertThat(SpanContext.INVALID.getTraceId()).isEqualTo(TraceId.INVALID); in invalidSpanContext()
53 assertThat(SpanContext.INVALID.getSpanId()).isEqualTo(SpanId.INVALID); in invalidSpanContext()
54 assertThat(SpanContext.INVALID.getTraceOptions()).isEqualTo(TraceOptions.DEFAULT); in invalidSpanContext()
59 assertThat(SpanContext.INVALID.isValid()).isFalse(); in isValid()
61 SpanContext.create( in isValid()
66 SpanContext.create( in isValid()
[all …]
/external/opencensus-java/api/src/main/java/io/opencensus/trace/propagation/
DBinaryFormat.java20 import io.opencensus.trace.SpanContext;
78 public byte[] toBinaryValue(SpanContext spanContext) { in toBinaryValue()
90 public byte[] toByteArray(SpanContext spanContext) { in toByteArray()
106 public SpanContext fromBinaryValue(byte[] bytes) throws ParseException { in fromBinaryValue()
123 public SpanContext fromByteArray(byte[] bytes) throws SpanContextParseException { in fromByteArray()
143 public byte[] toByteArray(SpanContext spanContext) { in toByteArray()
149 public SpanContext fromByteArray(byte[] bytes) { in fromByteArray()
151 return SpanContext.INVALID; in fromByteArray()
DTextFormat.java21 import io.opencensus.trace.SpanContext;
110 SpanContext spanContext, C carrier, Setter<C> setter); in inject()
145 public abstract <C /*>>> extends @NonNull Object*/> SpanContext extract( in extract()
191 SpanContext spanContext, C carrier, Setter<C> setter) { in inject()
198 public <C /*>>> extends @NonNull Object*/> SpanContext extract(C carrier, Getter<C> getter) { in extract()
201 return SpanContext.INVALID; in extract()
/external/opencensus-java/impl_core/src/test/java/io/opencensus/implcore/trace/propagation/
DBinaryFormatImplTest.java22 import io.opencensus.trace.SpanContext;
49 private static final SpanContext EXAMPLE_SPAN_CONTEXT =
50 SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS);
54 private void testSpanContextConversion(SpanContext spanContext) throws SpanContextParseException { in testSpanContextConversion()
55 SpanContext propagatedBinarySpanContext = in testSpanContextConversion()
66 SpanContext.create(TRACE_ID, SPAN_ID, TraceOptions.builder().setIsSampled(true).build())); in propagate_SpanContextTracingEnabled()
71 testSpanContextConversion(SpanContext.create(TRACE_ID, SPAN_ID, TraceOptions.DEFAULT)); in propagate_SpanContextNoTracing()
81 assertThat(binaryFormat.toByteArray(SpanContext.INVALID)) in toBinaryValue_InvalidSpanContext()
181 SpanContext extracted = in fromBinaryValue_MissingTraceOptionsOk()
DB3FormatTest.java26 import io.opencensus.trace.SpanContext;
75 b3Format.inject(SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS), carrier, setter); in serialize_SampledContext()
84 b3Format.inject(SpanContext.create(TRACE_ID, SPAN_ID, TraceOptions.DEFAULT), carrier, setter); in serialize_NotSampledContext()
94 SpanContext spanContext = SpanContext.create(TRACE_ID, SPAN_ID, TraceOptions.DEFAULT); in parseMissingSampledAndMissingFlag()
105 .isEqualTo(SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS)); in parseSampled()
115 .isEqualTo(SpanContext.create(TRACE_ID, SPAN_ID, TraceOptions.DEFAULT)); in parseZeroSampled()
125 .isEqualTo(SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS)); in parseFlag()
135 .isEqualTo(SpanContext.create(TRACE_ID, SPAN_ID, TraceOptions.DEFAULT)); in parseZeroFlag()
145 .isEqualTo(SpanContext.create(TRACE_ID_EIGHT_BYTES, SPAN_ID, TRACE_OPTIONS)); in parseEightBytesTraceId()
154 .isEqualTo(SpanContext.create(TRACE_ID_EIGHT_BYTES, SPAN_ID, TraceOptions.DEFAULT)); in parseEightBytesTraceId_NotSampledSpanContext()
/external/opencensus-java/contrib/appengine_standard_util/src/test/java/io/opencensus/contrib/appengine/standard/util/
DAppEngineCloudTraceContextUtilsTest.java23 import io.opencensus.trace.SpanContext;
65 SpanContext spanContext = in toFromSampledCloudTraceContext()
70 SpanContext.create( in toFromSampledCloudTraceContext()
113 SpanContext spanContext = in toFromNotSampledCloudTraceContext()
118 SpanContext.create( in toFromNotSampledCloudTraceContext()
139 .isEqualTo(SpanContext.INVALID); in toCloudTraceContext_Invalid()
151 AppEngineCloudTraceContextUtils.toCloudTraceContext(SpanContext.INVALID), in fromCloudTraceContext_Invalid()
/external/opencensus-java/api/src/test/java/io/opencensus/trace/propagation/
DBinaryFormatTest.java21 import io.opencensus.trace.SpanContext;
39 assertThat(binaryFormat.toBinaryValue(SpanContext.INVALID)).isEqualTo(new byte[0]); in toBinaryValue_NotNullSpanContext()
49 assertThat(binaryFormat.toByteArray(SpanContext.INVALID)).isEqualTo(new byte[0]); in toByteArray_NotNullSpanContext()
59 assertThat(binaryFormat.fromBinaryValue(new byte[0])).isEqualTo(SpanContext.INVALID); in fromBinaryValue_NotNullInput()
69 assertThat(binaryFormat.fromByteArray(new byte[0])).isEqualTo(SpanContext.INVALID); in fromByteArray_NotNullInput()
/external/opencensus-java/contrib/log_correlation/log4j2/src/main/java/io/opencensus/contrib/logcorrelation/log4j2/
DContextDataUtils.java21 import io.opencensus.trace.SpanContext;
68 SpanContext spanContext = shouldAddTracingDataToLogEvent(spanSelection); in shareableRawContextData()
75 SpanContext spanContext = shouldAddTracingDataToLogEvent(spanSelection); in nonShareableRawContextData()
84 private static SpanContext shouldAddTracingDataToLogEvent(SpanSelection spanSelection) { in shouldAddTracingDataToLogEvent()
89 SpanContext spanContext = getCurrentSpanContext(); in shouldAddTracingDataToLogEvent()
122 private static StringMap getShareableContextAndTracingData(SpanContext spanContext) { in getShareableContextAndTracingData()
148 private static SpanContext getCurrentSpanContext() { in getCurrentSpanContext()
150 return span == null ? SpanContext.INVALID : span.getContext(); in getCurrentSpanContext()
/external/opencensus-java/impl_core/src/main/java/io/opencensus/implcore/trace/
DSpanBuilderImpl.java30 import io.opencensus.trace.SpanContext;
54 @Nullable private final SpanContext remoteParentSpanContext;
61 @Nullable SpanContext parent, in startSpanInternal()
102 SpanContext.create(traceId, spanId, traceOptions, tracestate), in startSpanInternal()
112 SpanContext.create(traceId, spanId, traceOptions, tracestate)); in startSpanInternal()
118 @Nullable SpanContext parent, in makeSamplingDecision()
165 String spanName, @Nullable SpanContext remoteParentSpanContext, Options options) { in createWithRemoteParent()
171 @Nullable SpanContext remoteParentSpanContext, in SpanBuilderImpl()
182 SpanContext parentContext = remoteParentSpanContext; in startSpan()
/external/opencensus-java/contrib/log_correlation/log4j2/src/test/java/io/opencensus/contrib/logcorrelation/log4j2/
DOpenCensusLog4jLogCorrelationAllSpansTest.java23 import io.opencensus.trace.SpanContext;
53 SpanContext.create( in addSampledSpanToLogEntryWithAllSpans()
76 SpanContext.create( in addNonSampledSpanToLogEntryWithAllSpans()
99 SpanContext.INVALID, in addBlankSpanToLogEntryWithAllSpans()
118 SpanContext.create( in preserveOtherKeyValuePairs()
144 SpanContext.create( in overwriteExistingTracingKey()
DOpenCensusTraceContextDataInjectorTest.java24 import io.opencensus.trace.SpanContext;
155 SpanContext spanContext = in rawContextDataWithTracingData()
156 SpanContext.create( in rawContextDataWithTracingData()
188 SpanContext spanContext = in rawContextDataWithoutTracingData()
189 SpanContext.create( in rawContextDataWithoutTracingData()
/external/grpc-grpc/src/cpp/ext/filters/census/
Dcontext.cc26 using ::opencensus::trace::SpanContext;
33 SpanContext parent_ctx = trace_ctxt.ToSpanContext(); in GenerateServerContext()
40 SpanContext span_ctxt = parent_ctxt->Context(); in GenerateClientContext()
50 size_t TraceContextSerialize(const ::opencensus::trace::SpanContext& context, in TraceContextSerialize()
81 SpanContext SpanContextFromCensusContext(const census_context* ctxt) { in SpanContextFromCensusContext()
Dcontext.h53 const ::opencensus::trace::SpanContext& parent_ctxt) in CensusContext()
57 ::opencensus::trace::SpanContext Context() const { return span_.context(); } in Context()
67 size_t TraceContextSerialize(const ::opencensus::trace::SpanContext& context,
106 ::opencensus::trace::SpanContext SpanContextFromCensusContext(
/external/opencensus-java/impl_core/src/jmh/java/io/opencensus/implcore/trace/propagation/
DBinaryFormatImplBenchmark.java19 import io.opencensus.trace.SpanContext;
42 private SpanContext spanContext;
50 SpanContext.create( in setup()
76 public SpanContext fromBinarySpanContext(Data data) throws SpanContextParseException { in fromBinarySpanContext()
87 public SpanContext toFromBinarySpanContext(Data data) throws SpanContextParseException { in toFromBinarySpanContext()
DB3FormatImplBenchmark.java19 import io.opencensus.trace.SpanContext;
46 private SpanContext spanContext;
54 SpanContext.create( in setup()
83 public SpanContext extract(Data data) throws SpanContextParseException { in extract()
94 public SpanContext injectExtract(Data data) throws SpanContextParseException { in injectExtract()
/external/opencensus-java/contrib/log_correlation/stackdriver/src/test/java/io/opencensus/contrib/logcorrelation/stackdriver/
DOpenCensusTraceLoggingEnhancerTest.java33 import io.opencensus.trace.SpanContext;
66 SpanContext.create( in enhanceLogEntry_DoNotAddSampledSpanToLogEntryWithNoSpans()
80 SpanContext.create( in enhanceLogEntry_AddSampledSpanToLogEntryWithSampledSpans()
97 SpanContext.create( in enhanceLogEntry_AddSampledSpanToLogEntryWithAllSpans()
114 SpanContext.create( in enhanceLogEntry_DoNotAddNonSampledSpanToLogEntryWithNoSpans()
128 SpanContext.create( in enhanceLogEntry_DoNotAddNonSampledSpanToLogEntryWithSampledSpans()
142 SpanContext.create( in enhanceLogEntry_AddNonSampledSpanToLogEntryWithAllSpans()
171 SpanContext.create( in enhanceLogEntry_ConvertNullProjectIdToEmptyString()
324 TestSpan(SpanContext context) { in TestSpan()
/external/opencensus-java/contrib/http_util/src/test/java/io/opencensus/contrib/http/util/
DCloudTraceFormatTest.java27 import io.opencensus.trace.SpanContext;
101 private void parseSuccess(String headerValue, SpanContext expected) in parseSuccess()
122 SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS_SAMPLED), carrier, setter); in serializeSampledContextShouldSucceed()
131 SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS_NOT_SAMPLED), carrier, setter); in serializeNotSampledContextShouldSucceed()
141 SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS_SAMPLED)); in parseSampledShouldSucceed()
148 SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS_NOT_SAMPLED)); in parseNotSampledShouldSucceed()
155 SpanContext.create(TRACE_ID, SPAN_ID, TRACE_OPTIONS_NOT_SAMPLED)); in parseMissingTraceOptionsShouldSucceed()
253 SpanContext.create(TRACE_ID, SPAN_ID_MAX, TRACE_OPTIONS_SAMPLED)); in parseMaxUnsignedLongSpanIdShouldSucceed()
293 SpanContext.create(TRACE_ID, expectedSpanId, TRACE_OPTIONS_SAMPLED)); in parseWithShortSpanIdAndSamplingShouldSucceed()
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/
DCensusTracingModule.java40 import io.opencensus.trace.SpanContext;
91 final Metadata.Key<SpanContext> tracingHeader;
100 Metadata.Key.of("grpc-trace-bin", new Metadata.BinaryMarshaller<SpanContext>() { in CensusTracingModule()
102 public byte[] toBytes(SpanContext context) { in CensusTracingModule()
107 public SpanContext parseBytes(byte[] serialized) { in CensusTracingModule()
112 return SpanContext.INVALID; in CensusTracingModule()
302 ServerTracer(String fullMethodName, @Nullable SpanContext remoteSpan) { in ServerTracer()
367 SpanContext remoteSpan = headers.get(tracingHeader); in newServerStreamTracer()
368 if (remoteSpan == SpanContext.INVALID) { in newServerStreamTracer()
/external/opencensus-java/contrib/log_correlation/stackdriver/src/main/java/io/opencensus/contrib/logcorrelation/stackdriver/
DOpenCensusTraceLoggingEnhancer.java24 import io.opencensus.trace.SpanContext;
185 SpanContext span = getCurrentSpanContext(); in enhanceLogEntry()
197 private static SpanContext getCurrentSpanContext() { in getCurrentSpanContext()
199 return span == null ? SpanContext.INVALID : span.getContext(); in getCurrentSpanContext()
203 String tracePrefix, SpanContext span, LogEntry.Builder builder) { in addTracingData()
/external/opencensus-java/contrib/appengine_standard_util/src/main/java/io/opencensus/contrib/appengine/standard/util/
DAppEngineCloudTraceContextUtils.java23 import io.opencensus.trace.SpanContext;
54 public static SpanContext fromCloudTraceContext(CloudTraceContext cloudTraceContext) { in fromCloudTraceContext()
66 return SpanContext.create( in fromCloudTraceContext()
83 public static CloudTraceContext toCloudTraceContext(SpanContext spanContext) { in toCloudTraceContext()
/external/opencensus-java/api/src/test/java/io/opencensus/trace/samplers/
DSamplersTest.java24 import io.opencensus.trace.SpanContext;
46 private final SpanContext sampledSpanContext =
47 SpanContext.create(traceId, parentSpanId, TraceOptions.builder().setIsSampled(true).build());
48 private final SpanContext notSampledSpanContext =
49 SpanContext.create(traceId, parentSpanId, TraceOptions.DEFAULT);
127 Sampler sampler, SpanContext parent, List<Span> parentLinks, double probability) { in assertSamplerSamplesWithProbability()
/external/opencensus-java/impl_core/src/main/java/io/opencensus/implcore/trace/propagation/
DBinaryFormatImpl.java22 import io.opencensus.trace.SpanContext;
95 public byte[] toByteArray(SpanContext spanContext) { in toByteArray()
109 public SpanContext fromByteArray(byte[] bytes) throws SpanContextParseException { in fromByteArray()
146 return SpanContext.create(traceId, spanId, traceOptions, TRACESTATE_DEFAULT); in fromByteArray()
/external/opencensus-java/impl_core/src/test/java/io/opencensus/implcore/trace/
DNoRecordEventsSpanImplTest.java28 import io.opencensus.trace.SpanContext;
45 private final SpanContext spanContext =
46 SpanContext.create(
86 Link.fromSpanContext(SpanContext.INVALID, Link.Type.CHILD_LINKED_SPAN)); in doNotCrash()

1234