Skip to content

Commit

Permalink
docs for parse and to_grpc_insert_requests
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanbohan committed Oct 23, 2023
1 parent ed9cd57 commit ba33199
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/servers/src/otlp/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ pub struct TraceSpan {

pub type TraceSpans = Vec<TraceSpan>;

/// Convert OpenTelemetry traces to GreptimeDB row insert requests
///
/// See
/// <https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto>
/// for data structure of OTLP metrics.
///
/// Convert SpanTraces to GreptimeDB row insert requests.
/// Returns `InsertRequests` and total number of rows to ingest
pub fn to_grpc_insert_requests(
table_name: String,
Expand Down Expand Up @@ -198,6 +193,11 @@ pub fn parse_span(
}
}

/// Convert OpenTelemetry traces to SpanTraces
///
/// See
/// <https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto>
/// for data structure of OTLP traces.
pub fn parse(request: ExportTraceServiceRequest) -> TraceSpans {
let mut spans = vec![];
for resource_spans in request.resource_spans {
Expand Down

0 comments on commit ba33199

Please sign in to comment.