Java Code Examples for zipkin2.codec.Encoding#PROTO3

The following examples show how to use zipkin2.codec.Encoding#PROTO3 . 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: RestTemplateSender.java    From spring-cloud-sleuth with Apache License 2.0 6 votes vote down vote up
RestTemplateSender(RestTemplate restTemplate, String baseUrl,
		BytesEncoder<Span> encoder) {
	this.restTemplate = restTemplate;
	this.encoding = encoder.encoding();
	if (encoder.equals(JSON_V2)) {
		this.mediaType = MediaType.APPLICATION_JSON;
		this.url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "api/v2/spans";
	}
	else if (this.encoding == Encoding.PROTO3) {
		this.mediaType = MediaType.parseMediaType("application/x-protobuf");
		this.url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "api/v2/spans";
	}
	else if (this.encoding == Encoding.JSON) {
		this.mediaType = MediaType.APPLICATION_JSON;
		this.url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "api/v1/spans";
	}
	else {
		throw new UnsupportedOperationException(
				"Unsupported encoding: " + this.encoding.name());
	}
	this.messageEncoder = BytesMessageEncoder.forEncoding(this.encoding);
}
 
Example 2
Source File: TarsTraceZipkinConfiguration.java    From TarsJava with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private Encoding createCodec() throws NotSupportedSuchSampleEncodingException {
	if ("json".endsWith(serverConfig.getSampleEncoding())) {
		return Encoding.JSON;
	}
	if ("proto".endsWith(serverConfig.getSampleEncoding())) {
		return Encoding.PROTO3;
	}
	throw new NotSupportedSuchSampleEncodingException("unsupported sample encoding");
}
 
Example 3
Source File: TracingConfiguration.java    From pivotal-bank-demo with Apache License 2.0 4 votes vote down vote up
@Override
public Encoding encoding() {
  return Encoding.PROTO3;
}
 
Example 4
Source File: StackdriverSender.java    From zipkin-gcp with Apache License 2.0 4 votes vote down vote up
@Override
public Encoding encoding() {
  return Encoding.PROTO3;
}
 
Example 5
Source File: RequestBodyMessageEncoder.java    From zipkin-reporter-java with Apache License 2.0 4 votes vote down vote up
Protobuf3RequestBody(List<byte[]> values) {
  super(Encoding.PROTO3, CONTENT_TYPE, values);
}
 
Example 6
Source File: AsyncReporterFactoryBeanTest.java    From zipkin-reporter-java with Apache License 2.0 4 votes vote down vote up
@Override public Encoding encoding() {
  return Encoding.PROTO3;
}