Skip to content

Commit

Permalink
[refactor] Inline proto definiton of KeyValue from OTEL (#6775)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Towards #6629

## Description of the changes
- This PR moves the definition of
`opentelemetry.proto.common.v1.KeyValue` inline to avoid an external
dependency and to fix marshalling compatibility issues.

## 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 <mahadzaryab1@gmail.com>
  • Loading branch information
mahadzaryab1 authored Feb 26, 2025
1 parent 300cc7c commit ce07285
Show file tree
Hide file tree
Showing 2 changed files with 378 additions and 71 deletions.
32 changes: 29 additions & 3 deletions internal/storage/v2/grpc/trace_storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package jaeger.storage.v2;
import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "opentelemetry/proto/common/v1/common.proto";
import "opentelemetry/proto/trace/v1/trace.proto";

option go_package = "storage";
Expand Down Expand Up @@ -64,13 +63,41 @@ message GetOperationsResponse {
repeated Operation operations = 1;
}

// KeyValue and all its associated types are copied from opentelemetry-proto/common/v1/common.proto
// (/~https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/common/v1/common.proto).
// This type is used to store attributes in traces.
message KeyValue {
string key = 1;
AnyValue value = 2;
}

message AnyValue {
oneof value {
string string_value = 1;
bool bool_value = 2;
int64 int_value = 3;
double double_value = 4;
ArrayValue array_value = 5;
KeyValueList kvlist_value = 6;
bytes bytes_value = 7;
}
}

message KeyValueList {
repeated KeyValue values = 1;
}

message ArrayValue {
repeated AnyValue values = 1;
}

// TraceQueryParameters contains query parameters to find traces. For a detailed
// definition of each field in this message, refer to `TraceQueryParameters` in `jaeger.api_v3`
// (/~https://github.com/jaegertracing/jaeger-idl/blob/main/proto/api_v3/query_service.proto).
message TraceQueryParameters {
string service_name = 1;
string operation_name = 2;
repeated opentelemetry.proto.common.v1.KeyValue attributes = 3;
repeated KeyValue attributes = 3;
google.protobuf.Timestamp start_time_min = 4 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
Expand All @@ -97,7 +124,6 @@ message FindTracesRequest {
TraceQueryParameters query = 1;
}


// FoundTraceID is a wrapper around trace ID returned from FindTraceIDs
// with an optional time range that may be used in GetTraces calls.
//
Expand Down
Loading

0 comments on commit ce07285

Please sign in to comment.