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

zipkin2.reporter.brave.JsonV2Encoder Maven / Gradle / Ivy

There is a newer version: 3.4.2
Show newest version
/*
 * Copyright The OpenZipkin Authors
 * SPDX-License-Identifier: Apache-2.0
 */
package zipkin2.reporter.brave;

import brave.Tag;
import brave.Tags;
import brave.handler.MutableSpan;
import brave.handler.MutableSpanBytesEncoder;
import zipkin2.reporter.BytesEncoder;
import zipkin2.reporter.Encoding;

final class JsonV2Encoder implements BytesEncoder {
  static final BytesEncoder INSTANCE = new JsonV2Encoder(Tags.ERROR);
  final MutableSpanBytesEncoder delegate;

  JsonV2Encoder(Tag errorTag) {
    this.delegate = MutableSpanBytesEncoder.zipkinJsonV2(errorTag);
  }

  @Override public Encoding encoding() {
    return Encoding.JSON;
  }

  @Override public int sizeInBytes(MutableSpan span) {
    return delegate.sizeInBytes(span);
  }

  @Override public byte[] encode(MutableSpan span) {
    return delegate.encode(span);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy