Merged
Conversation
zzylol
reviewed
Mar 11, 2026
Contributor
|
@milindsrivastava1997 This PR is also a separate ingest driver from the current Kafka Arroyo path. So once ready, should be no harm to merge into main. |
zzylol
approved these changes
Mar 18, 2026
milindsrivastava1997
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OTLP Ingest Driver - Design Document
Overview
This document describes the design and implementation of the OTLP (OpenTelemetry Protocol) receiver in ASAP Query Engine. The receiver accepts metrics from OTLP clients (SDKs, OpenTelemetry Collector, test generators) via standard gRPC and HTTP protocols.
Why OtlpReceiver
Based on industry research,
OtlpReceiverwas chosen as the component name.Rationale
Industry Standard: The term "OTLP Receiver" is consistently used across the OpenTelemetry ecosystem:
OpenTelemetry Collector: Official component is called "OTLP Receiver"
receivers: otlp:Prometheus: Uses "receiver" terminology
--web.enable-otlp-receiverVictoriaMetrics: While using "opentelemetry" in package names, their handlers accept/receive OTLP data
app/vmagent/opentelemetryTechnical Documentation: Industry guides consistently use "OTLP receiver"
Alternatives Considered
Architecture
Component Overview
Protocol Support
gRPC (Port 4317)
MetricsService::exportfromopentelemetry_protoExportMetricsServiceRequestExportMetricsServiceResponseHTTP (Port 4318)
POST /v1/metricsExportMetricsServiceRequest{"rejected": 0}Note: The
/v1/metricspath is the OTLP specification default and is auto-appended by the OpenTelemetry Collector. Reference: VictoriaMetrics PR #5871Implementation Details
File Structure
Core Types
Request Processing
Both gRPC and HTTP handlers call
process_otlp_request:Metric Counting
The
otlp_to_record_countfunction traverses the OTLP hierarchy:resource_metrics[]- Metrics grouped by resource (host, service)scope_metrics[]- Metrics grouped by instrumentation scopemetrics[]- Individual metric definitionsdata_points[]- Time series samplesSupported OTLP metric types:
_sum,_count,_bucket)_sum,_count,_scale)_sum,_count, quantile values)Configuration
CLI Flags
Example Usage
With debug logging:
OpenTelemetry Collector Integration
Collector Configuration
To send metrics from an OpenTelemetry Collector to ASAP Query Engine:
Key Points:
host:port(no path)http://host:port(collector auto-appends/v1/metrics)Testing
With otlp_exporter
Expected Debug Output
Dependencies
Added to
asap-query-engine/Cargo.toml:What We Implemented
The OTLP receiver accepts metrics via gRPC (port 4317) and HTTP (port 4318,
POST /v1/metrics). It parsesExportMetricsServiceRequest, counts resource metrics and data points, and logs them at DEBUG level.TODO: Forward received metrics to the precompute engine (handoff point is in code).