All Downloads are FREE. Search and download functionalities are using the official Maven repository.

datadog.opentracing.OTSpanContext Maven / Gradle / Ivy

There is a newer version: 1.42.2
Show newest version
package datadog.opentracing;

import datadog.trace.api.DDSpanId;
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
import io.opentracing.SpanContext;
import java.util.Map;

class OTSpanContext implements SpanContext {
  private final AgentSpan.Context delegate;

  OTSpanContext(final AgentSpan.Context delegate) {
    this.delegate = delegate;
  }

  @Override
  public String toTraceId() {
    return delegate.getTraceId().toString();
  }

  @Override
  public String toSpanId() {
    return DDSpanId.toString(delegate.getSpanId());
  }

  @Override
  public Iterable> baggageItems() {
    return delegate.baggageItems();
  }

  AgentSpan.Context getDelegate() {
    return delegate;
  }

  @Override
  public boolean equals(final Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    final OTSpanContext that = (OTSpanContext) o;
    return delegate.equals(that.delegate);
  }

  @Override
  public int hashCode() {
    return delegate.hashCode();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy