private void serializeSpanContext(SpanContext context) { writeFieldName("context"); jw.writeByte(OBJECT_START); boolean spanContextWritten = false; Db db = context.getDb(); if (db.hasContent()) { serializeDbContext(db); spanContextWritten = true; } Http http = context.getHttp(); if (http.hasContent()) { if (spanContextWritten) { jw.writeByte(COMMA); } serializeHttpContext(http); spanContextWritten = true; } Map<String, String> tags = context.getTags(); if (!tags.isEmpty()) { if (spanContextWritten) { jw.writeByte(COMMA); } writeFieldName("tags"); serializeTags(tags); } jw.writeByte(OBJECT_END); jw.writeByte(COMMA); }
.withSubtype("http") .withAction("apache-httpclient"); span.getContext().getHttp() .withUrl("http://test.elastic.co/test-service") .withMethod("POST")