Class LogsCollector
java.lang.Object
java.util.concurrent.SubmissionPublisher<RECORD>
io.mishmash.opentelemetry.server.collector.AbstractCollector<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,Log>
io.mishmash.opentelemetry.server.collector.LogsCollector
- All Implemented Interfaces:
AutoCloseable,Flow.Publisher<Log>
public class LogsCollector
extends AbstractCollector<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,Log>
Processes incoming OpenTelemetry logs packets - extracts individual
Logs from a packet and queues them to all
LogsSubscribers.
Also notifies the client on potential errors.-
Field Summary
Fields inherited from class io.mishmash.opentelemetry.server.collector.AbstractCollector
DEFAULT_CLOSE_TIMETOUT_SEC, DEFAULT_MAX_BODY_LEN, DEFAULT_SUBSCRIBER_QUEUE_SIZE, DEFAULT_TIMEOUT_SEC, HTTP_BAD_GATEWAY, HTTP_BAD_REQUEST, HTTP_EXPECTATION_FAILED, HTTP_GATEWAY_TIMEOUT, HTTP_INTERNAL_ERROR, HTTP_OK, HTTP_PAYLOAD_TOO_LARGE, HTTP_SERVICE_UNAVAILABLE, HTTP_TOO_MANY_REQUESTS -
Constructor Summary
ConstructorsConstructorDescriptionLogsCollector(io.grpc.MethodDescriptor<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> exportMethod, Instrumentation otel) Creates a new logs collector to be added to a Vert.x routing context. -
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponsegetBatchResponse(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request, Batch<Log> completedBatch, String transport, String encoding) Called to compute the correct response to the client after an entire batch (or packet) of OpenTelemetry logs, metrics or spans has been processed.loadBatch(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request, String transport, String encoding, io.opentelemetry.context.Context otelContext) Processes incoming packets (or batches) - extracts and publishes the contained OpenTelemetry LogRecords (one by one) to allLogsSubscribers.protected StringReturns "logs" as the signal type for this collector's own telemetry.Methods inherited from class io.mishmash.opentelemetry.server.collector.AbstractCollector
addDroppedRequestItems, addFailedRequests, addGrpcFailedRequests, addHttpFailedRequests, addPartiallySucceededRequests, addRequestItems, addRequestsInProcess, addSucceededRequests, bind, bind, checkBody, checkContentType, checkSubscribers, close, closeExceptionally, getErrorCode, getInstrumentation, getOtelContext, getOtelRequest, getOtelResponse, handle, httpEncoding, initInstrumentation, isError, isJsonContent, isJsonRequest, isProtobufContent, isRetryable, isRetryable, parseContentLengthHeader, parseHttpJson, parseHttpProtobuf, parseHttpRequest, publish, publish, respond, respond, responseToJson, responseToProtobuf, setErrorCode, setJsonRequest, setOtelContext, setOtelRequest, setOtelResponseMethods inherited from class java.util.concurrent.SubmissionPublisher
consume, estimateMaximumLag, estimateMinimumDemand, getClosedException, getExecutor, getMaxBufferCapacity, getNumberOfSubscribers, getSubscribers, hasSubscribers, isClosed, isSubscribed, offer, offer, submit, subscribe
-
Constructor Details
-
LogsCollector
public LogsCollector(io.grpc.MethodDescriptor<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> exportMethod, Instrumentation otel) Creates a new logs collector to be added to a Vert.x routing context.- Parameters:
exportMethod- the gRPC method to be attached tootel- a helper for own telemetry needs
-
-
Method Details
-
loadBatch
public Batch<Log> loadBatch(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request, String transport, String encoding, io.opentelemetry.context.Context otelContext) Processes incoming packets (or batches) - extracts and publishes the contained OpenTelemetry LogRecords (one by one) to allLogsSubscribers.- Specified by:
loadBatchin classAbstractCollector<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse, Log> - Parameters:
request- the client's OTLP requesttransport- the OTLP transport - "grpc" or "http"encoding- the OTLP encoding - "protobuf" or "json"otelContext- theContextused for own telemetry- Returns:
- a new
Batchwith all items of the request
-
getBatchResponse
public io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse getBatchResponse(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request, Batch<Log> completedBatch, String transport, String encoding) Called to compute the correct response to the client after an entire batch (or packet) of OpenTelemetry logs, metrics or spans has been processed.- Specified by:
getBatchResponsein classAbstractCollector<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse, Log> - Parameters:
request- the original request from the clientcompletedBatch- the completed batch of recordstransport- the OTLP transport used - "grpc" or "http"encoding- - the OTLP encoding - "protobuf" or "json"- Returns:
- the correct OTLP reposne to be sent back to the client
-
telemetrySignalType
Returns "logs" as the signal type for this collector's own telemetry.- Specified by:
telemetrySignalTypein classAbstractCollector<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse, Log> - Returns:
- the signal type
-