Java Code Examples for brave.baggage.BaggageField#getByName()

The following examples show how to use brave.baggage.BaggageField#getByName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BraveSpan.java    From brave-opentracing with Apache License 2.0 5 votes vote down vote up
/** This is a NOOP unless {@link BaggagePropagation} is in use */
@Override public BraveSpan setBaggageItem(String key, String value) {
  BaggageField field = BaggageField.getByName(delegate.context(), key);
  if (field == null) return this;
  field.updateValue(delegate.context(), value);
  return this;
}
 
Example 2
Source File: BraveSpan.java    From brave-opentracing with Apache License 2.0 4 votes vote down vote up
/** Returns null unless {@link BaggagePropagation} is in use */
@Override public String getBaggageItem(String key) {
  BaggageField field = BaggageField.getByName(delegate.context(), key);
  if (field == null) return null;
  return field.getValue(delegate.context());
}
 
Example 3
Source File: ExtraFieldPropagation.java    From brave with Apache License 2.0 4 votes vote down vote up
/**
 * @deprecated Since 5.11 use {@link BaggageField#getByName(String)} and {@link
 * BaggageField#getValue()}
 */
@Deprecated @Nullable public static String get(String name) {
  BaggageField field = BaggageField.getByName(validateFieldName(name));
  if (field == null) return null;
  return field.getValue();
}
 
Example 4
Source File: ExtraFieldPropagation.java    From brave with Apache License 2.0 4 votes vote down vote up
/**
 * @deprecated Since 5.11 use {@link BaggageField#getByName(String)} and {@link
 * BaggageField#updateValue(String)}
 */
@Deprecated public static void set(String name, String value) {
  BaggageField field = BaggageField.getByName(validateFieldName(name));
  if (field == null) return;
  field.updateValue(value);
}
 
Example 5
Source File: ExtraFieldPropagation.java    From brave with Apache License 2.0 4 votes vote down vote up
/**
 * @deprecated Since 5.11 use {@link BaggageField#getByName(TraceContext, String)} and {@link
 * BaggageField#getValue(TraceContext)}
 */
@Deprecated @Nullable public static String get(TraceContext context, String name) {
  BaggageField field = BaggageField.getByName(context, validateFieldName(name));
  if (field == null) return null;
  return field.getValue(context);
}
 
Example 6
Source File: ExtraFieldPropagation.java    From brave with Apache License 2.0 4 votes vote down vote up
/**
 * @deprecated Since 5.11 use {@link BaggageField#getByName(TraceContext, String)} and {@link
 * BaggageField#updateValue(String)}
 */
@Deprecated public static void set(TraceContext context, String name, String value) {
  BaggageField field = BaggageField.getByName(context, validateFieldName(name));
  if (field == null) return;
  field.updateValue(context, value);
}
 
Example 7
Source File: BraveSpan.java    From brave with Apache License 2.0 4 votes vote down vote up
@Override public io.opentracing.Span setBaggageItem(String key, String value) {
  BaggageField field = BaggageField.getByName(delegate.context(), key);
  if (field == null) return this;
  field.updateValue(delegate.context(), value);
  return this;
}
 
Example 8
Source File: BraveSpan.java    From brave with Apache License 2.0 4 votes vote down vote up
@Override public String getBaggageItem(String key) {
  BaggageField field = BaggageField.getByName(delegate.context(), key);
  return field != null ? field.getValue(delegate.context()) : null;
}