Skip to content

Commit

Permalink
[remote-storage][v2] Add proto definition for GetServices and `GetO…
Browse files Browse the repository at this point in the history
…perations` rpc (#6736)

## Which problem is this PR solving?
- Resolves #6629

## Description of the changes
- This PR creates a protobuf definition in traces_storage.proto for the
`GetServices` and `GetOperations` RPCs.

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 authored Feb 16, 2025
1 parent f956a13 commit 316cbe3
Show file tree
Hide file tree
Showing 2 changed files with 395 additions and 51 deletions.
95 changes: 66 additions & 29 deletions internal/storage/v2/grpc/trace_storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,77 @@ option go_package = "storage";

// GetTraceParams represents the query for a single trace from the storage backend.
message GetTraceParams {
// trace_id is a 16 byte array containing the unique identifier for the trace to query.
bytes trace_id = 1;

// start_time is the start of the time interval to search for the trace_id.
//
// This field is optional.
google.protobuf.Timestamp start_time = 2 [
(gogoproto.stdtime) = true
];

// end_time is the end of the time interval to search for the trace_id.
//
// This field is optional.
google.protobuf.Timestamp end_time = 3 [
(gogoproto.stdtime) = true
];
// trace_id is a 16 byte array containing the unique identifier for the trace to query.
bytes trace_id = 1;

// start_time is the start of the time interval to search for the trace_id.
//
// This field is optional.
google.protobuf.Timestamp start_time = 2 [(gogoproto.stdtime) = true];

// end_time is the end of the time interval to search for the trace_id.
//
// This field is optional.
google.protobuf.Timestamp end_time = 3 [(gogoproto.stdtime) = true];
}

// GetTracesRequest represents a request to retrieve multiple traces.
message GetTracesRequest {
repeated GetTraceParams query = 1;
}

// GetServicesRequest represents a request to get service names.
message GetServicesRequest {}

// GetServicesResponse represents the response for GetServicesRequest.
message GetServicesResponse {
repeated string services = 1;
}

// GetOperationsRequest represents a request to get operation names.
message GetOperationsRequest {
// service is the name of the service for which to get operation names.
//
// This field is required.
string service = 1;

// span_kind is the type of span which is used to distinguish between
// spans generated in a particular context.
//
// This field is optional.
opentelemetry.proto.trace.v1.Span.SpanKind span_kind = 2;
}

// Operation contains information about an operation for a given service.
message Operation {
string name = 1;
opentelemetry.proto.trace.v1.Span.SpanKind span_kind = 2;
}

// GetOperationsResponse represents the response for GetOperationsRequest.
message GetOperationsResponse {
repeated Operation operations = 1;
}

service TraceReader {
// GetTraces returns a stream that retrieves all traces with given IDs.
//
// Chunking requirements:
// - A single TracesData chunk MUST NOT contain spans from multiple traces.
// - Large traces MAY be split across multiple, *consecutive* TracesData chunks.
// - Each returned TracesData object MUST NOT be empty.
//
// Edge cases:
// - If no spans are found for any given trace ID, the ID is ignored.
// - If none of the trace IDs are found in the storage, an empty response is returned.
// - If an error is encountered, the stream returns the error and stops.
rpc GetTraces(GetTracesRequest) returns (stream opentelemetry.proto.trace.v1.TracesData) {}
}
// GetTraces returns a stream that retrieves all traces with given IDs.
//
// Chunking requirements:
// - A single TracesData chunk MUST NOT contain spans from multiple traces.
// - Large traces MAY be split across multiple, *consecutive* TracesData chunks.
// - Each returned TracesData object MUST NOT be empty.
//
// Edge cases:
// - If no spans are found for any given trace ID, the ID is ignored.
// - If none of the trace IDs are found in the storage, an empty response is returned.
// - If an error is encountered, the stream returns the error and stops.
rpc GetTraces(GetTracesRequest) returns (stream opentelemetry.proto.trace.v1.TracesData) {}

// GetServices returns all service names known to the backend from traces
// within its retention period.
rpc GetServices(GetServicesRequest) returns (GetServicesResponse) {}

// GetOperations returns all operation names for a given service
// known to the backend from traces within its retention period.
rpc GetOperations(GetOperationsRequest) returns (GetOperationsResponse) {}
}
Loading

0 comments on commit 316cbe3

Please sign in to comment.