Search in sources :

Example 1 with Span

use of com.creditease.uav.invokechain.data.Span in project uavstack by uavorg.

the class InvokeChainDataCollectHandler method handle.

@Override
public void handle(CollectDataFrame frame) {
    if (this.log.isDebugEnable()) {
        this.log.debug(this, frame.toJSONString());
    }
    String appUUID = frame.getTarget();
    // cm.beginBatch();
    BulkRequestBuilder bulkRequest = client.getClient().prepareBulk();
    for (Line line : frame.getLines()) {
        String content = line.getContent();
        Span span = new Span(content);
        pushLatestIVCDataToCache(appUUID, span);
        pushSpanToBulkRequest(appUUID, frame.getAppgroup(), span, bulkRequest);
    }
    // cm.submitBatch();
    BulkResponse bulkResponse = bulkRequest.get();
    if (bulkResponse.hasFailures()) {
        log.err(this, "INSERT InvokeChain Data to ES FAIL: " + bulkResponse.buildFailureMessage());
    }
}
Also used : Line(com.creditease.agent.apm.api.CollectDataFrame.Line) BulkResponse(org.elasticsearch.action.bulk.BulkResponse) BulkRequestBuilder(org.elasticsearch.action.bulk.BulkRequestBuilder) Span(com.creditease.uav.invokechain.data.Span)

Aggregations

Line (com.creditease.agent.apm.api.CollectDataFrame.Line)1 Span (com.creditease.uav.invokechain.data.Span)1 BulkRequestBuilder (org.elasticsearch.action.bulk.BulkRequestBuilder)1 BulkResponse (org.elasticsearch.action.bulk.BulkResponse)1