/** Sends an empty json message to the configured endpoint. */ @Override public CheckResult check() { try { send(new byte[] {'[', ']'}, "application/json"); return CheckResult.OK; } catch (Exception e) { return CheckResult.failed(e); } }
/** Asynchronously sends the spans as a POST to {@link #endpoint()}. */ @Override public void sendSpans(List<byte[]> encodedSpans, Callback callback) { if (closeCalled) throw new IllegalStateException("close"); try { byte[] message = encoder().encode(encodedSpans); send(message, mediaType()); callback.onComplete(); } catch (Throwable e) { callback.onError(e); if (e instanceof Error) throw (Error) e; } }