Package io.mishmash.opentelemetry.server.collector
OpenTelemetry collectors
This package contains the main classes used to embed OpenTelemetry
collectors. Use one or all of LogsCollector,
MetricsCollector and TracesCollector to create
an OTEL data source for your system.
To use them:
- Instantiate one of the collectors
-
Implement one or more subscribers -
LogsSubscriber,MetricsSubscriber,SpansSubscriberto receive incoming OpenTelemetry signals of a given type -
Subscribe them to the collector -
SubmissionPublisher.subscribe(java.util.concurrent.Flow.Subscriber) -
Setup gRPC and HTTP Vert.x servers and bind the collector to them -
AbstractCollector.bind(io.vertx.grpc.server.GrpcServer)andAbstractCollector.bind(io.vertx.ext.web.Router).
When OTLP clients connect to the server and submit data - each individual
data item in them - a log entry, a metric data point or a span - will be
delivered to the subscribers' LogsSubscriber.onNext(Log),
MetricsSubscriber.onNext(MetricDataPoint) or
SpansSubscriber.onNext(Span) where you can make it available
within the system you're embedding into.
This package is part of a broader set of OpenTelemetry-related activities at mishmash io. To find out more about this and other packages visit the links below.
-
ClassDescriptionAbstractCollector<REQ extends com.google.protobuf.AbstractMessage,
RESP extends com.google.protobuf.AbstractMessage, RECORD> This class handles the OTLP protocol for gRPC and HTTP transports for a collector of a given signal type (like logs, metrics or traces).Batch<T>Contains a number of elements that should be processed together, and in parallel, but actual processing might happen at different paces.AnExceptionthat also contains theGrpcStatusthat should be returned to the client.A simple class with helper methods for OpenTelemetry embedded collectors own telemetry.Holds the details of an individual OTLP log record received from a client as aBatchof all subscribers that are expected to process it.Processes incoming OpenTelemetry logs packets - extracts individual Logs from a packet and queues them to allLogsSubscribers.AFlow.Subscriberfor OpenTelemetryLogrecords.Holds the details of an individual OTLP metric data point received from a client as aBatchof all subscribers that are expected to process it.Processes incoming OpenTelemetry metrics packets - extracts all data points of all metrics contained in a packet and queues them to allMetricsSubscribers.AFlow.Subscriberfor OpenTelemetryMetricDataPointrecords.Holds the details of an individual OTLP span record received from a client as aBatchof all subscribers that are expected to process it.AFlow.Subscriberfor OpenTelemetrySpanrecords.A 'batch' of allLogsSubscribers,MetricsSubscribers or @{link SpansSubscribers} that were given the task to process an OpenTelemetry log record, metric data point or trace span.Processes incoming OpenTelemetry traces packets - extracts individual Spans from a packet and queues them to allSpansSubscribers.AnInputStreamthat takes a Vert.xReadStreamand reads it up to a given number of bytes.