Tabnine Logo
LogEntry.getTraceSampled
Code IndexAdd Tabnine to your IDE (free)

How to use
getTraceSampled
method
in
com.google.cloud.logging.LogEntry

Best Java code snippets using com.google.cloud.logging.LogEntry.getTraceSampled (Showing top 7 results out of 315)

origin: googleapis/google-cloud-java

assertNull(logEntry.getTrace());
assertNull(logEntry.getSpanId());
assertFalse(logEntry.getTraceSampled());
assertNull(logEntry.getSourceLocation());
logEntry = LogEntry.of(LOG_NAME, RESOURCE, STRING_PAYLOAD);
assertNull(logEntry.getTrace());
assertNull(logEntry.getSpanId());
assertFalse(logEntry.getTraceSampled());
assertNull(logEntry.getSourceLocation());
origin: googleapis/google-cloud-java

 private void compareLogEntry(LogEntry expected, LogEntry value) {
  assertEquals(expected, value);
  assertEquals(expected.getLogName(), value.getLogName());
  assertEquals(expected.getResource(), value.getResource());
  assertEquals(expected.getTimestamp(), value.getTimestamp());
  assertEquals(expected.getReceiveTimestamp(), value.getReceiveTimestamp());
  assertEquals(expected.getSeverity(), value.getSeverity());
  assertEquals(expected.getInsertId(), value.getInsertId());
  assertEquals(expected.getHttpRequest(), value.getHttpRequest());
  assertEquals(expected.getLabels(), value.getLabels());
  assertEquals(expected.getOperation(), value.getOperation());
  assertEquals(expected.getTrace(), value.getTrace());
  assertEquals(expected.getSpanId(), value.getSpanId());
  assertEquals(expected.getTraceSampled(), value.getTraceSampled());
  assertEquals(expected.getSourceLocation(), value.getSourceLocation());
  assertEquals(expected.getPayload(), value.getPayload());
  assertEquals(expected.hashCode(), value.hashCode());
 }
}
origin: googleapis/google-cloud-java

assertEquals(TRACE, STRING_ENTRY.getTrace());
assertEquals(SPAN_ID, STRING_ENTRY.getSpanId());
assertEquals(TRACE_SAMPLED, STRING_ENTRY.getTraceSampled());
assertEquals(SOURCE_LOCATION, STRING_ENTRY.getSourceLocation());
assertEquals(STRING_PAYLOAD, STRING_ENTRY.getPayload());
assertEquals(TRACE, JSON_ENTRY.getTrace());
assertEquals(SPAN_ID, JSON_ENTRY.getSpanId());
assertEquals(TRACE_SAMPLED, JSON_ENTRY.getTraceSampled());
assertEquals(SOURCE_LOCATION, JSON_ENTRY.getSourceLocation());
assertEquals(JSON_PAYLOAD, JSON_ENTRY.getPayload());
assertEquals(TRACE, PROTO_ENTRY.getTrace());
assertEquals(SPAN_ID, PROTO_ENTRY.getSpanId());
assertEquals(TRACE_SAMPLED, PROTO_ENTRY.getTraceSampled());
assertEquals(SOURCE_LOCATION, PROTO_ENTRY.getSourceLocation());
assertEquals(PROTO_PAYLOAD, PROTO_ENTRY.getPayload());
assertEquals(TRACE, logEntry.getTrace());
assertEquals(SPAN_ID, logEntry.getSpanId());
assertEquals(TRACE_SAMPLED, logEntry.getTraceSampled());
assertEquals(SOURCE_LOCATION, logEntry.getSourceLocation());
assertEquals(StringPayload.of("otherPayload"), logEntry.getPayload());
origin: googleapis/google-cloud-java

assertEquals("otherTrace", logEntry.getTrace());
assertEquals("otherSpanId", logEntry.getSpanId());
assertFalse(logEntry.getTraceSampled());
assertEquals(
  new SourceLocation.Builder().setFile("hey.java").build(), logEntry.getSourceLocation());
origin: census-instrumentation/opencensus-java

@Test
public void enhanceLogEntry_AddBlankSpanToLogEntry() {
 LogEntry logEntry =
   getEnhancedLogEntry(
     new OpenCensusTraceLoggingEnhancer("my-test-project-7"), BlankSpan.INSTANCE);
 assertFalse(logEntry.getTraceSampled());
 assertThat(logEntry.getTrace())
   .isEqualTo("projects/my-test-project-7/traces/00000000000000000000000000000000");
 assertThat(logEntry.getSpanId()).isEqualTo("0000000000000000");
}
origin: census-instrumentation/opencensus-java

@Test
public void enhanceLogEntry_AddNonSampledSpanToLogEntry() {
 LogEntry logEntry =
   getEnhancedLogEntry(
     new OpenCensusTraceLoggingEnhancer("my-test-project-6"),
     new TestSpan(
       SpanContext.create(
         TraceId.fromLowerBase16("72c905c76f99e99974afd84dc053a480"),
         SpanId.fromLowerBase16("731e102335b7a5a0"),
         TraceOptions.builder().setIsSampled(false).build(),
         EMPTY_TRACESTATE)));
 assertFalse(logEntry.getTraceSampled());
 assertThat(logEntry.getTrace())
   .isEqualTo("projects/my-test-project-6/traces/72c905c76f99e99974afd84dc053a480");
 assertThat(logEntry.getSpanId()).isEqualTo("731e102335b7a5a0");
}
origin: census-instrumentation/opencensus-java

@Test
public void enhanceLogEntry_AddSampledSpanToLogEntry() {
 LogEntry logEntry =
   getEnhancedLogEntry(
     new OpenCensusTraceLoggingEnhancer("my-test-project-3"),
     new TestSpan(
       SpanContext.create(
         TraceId.fromLowerBase16("4c6af40c499951eb7de2777ba1e4fefa"),
         SpanId.fromLowerBase16("de52e84d13dd232d"),
         TraceOptions.builder().setIsSampled(true).build(),
         EMPTY_TRACESTATE)));
 assertTrue(logEntry.getTraceSampled());
 assertThat(logEntry.getTrace())
   .isEqualTo("projects/my-test-project-3/traces/4c6af40c499951eb7de2777ba1e4fefa");
 assertThat(logEntry.getSpanId()).isEqualTo("de52e84d13dd232d");
}
com.google.cloud.loggingLogEntrygetTraceSampled

Javadoc

Returns the sampling decision of the trace span associated with the log entry, or falseif there is no trace span.

Popular methods of LogEntry

  • newBuilder
    Returns a builder for LogEntry objects given the entry payload.
  • getSpanId
    Returns the ID of the trace span associated with the log entry, if any.
  • getTrace
    Returns the resource name of the trace associated with the log entry, if any. If it contains a relat
  • fromPb
  • getSeverity
    Returns the severity of the log entry. If not set, Severity#DEFAULT is used.
  • getTimestamp
    Returns the time at which the event described by the log entry occurred, in milliseconds. If omitted
  • of
    Creates a LogEntry object given the log name, the monitored resource and the entry payload.
  • toBuilder
    Returns a Builder for this log entry.
  • toPb
  • toPbFunction
  • <init>
  • getHttpRequest
    Returns information about the HTTP request associated with this log entry, if applicable.
  • <init>,
  • getHttpRequest,
  • getInsertId,
  • getLabels,
  • getLocation,
  • getLogName,
  • getOperation,
  • getPayload,
  • getReceiveTimestamp

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • String (java.lang)
  • Permission (java.security)
    Legacy security code; do not use.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now