From bdd5ab5514b3dbb8d3924cf6bc1b28e356df6ae3 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 14 Jan 2024 14:30:09 -0500 Subject: [PATCH 1/3] Upgrade to opentelemetry-proto v1.1.0 (#104) * Upgrade to opentelemetry-proto v1.1.0 Signed-off-by: Yuri Shkuro * separate Signed-off-by: Yuri Shkuro * regen Signed-off-by: Yuri Shkuro --------- Signed-off-by: Yuri Shkuro --- Makefile | 12 +++++- opentelemetry-proto | 2 +- swagger/api_v3/query_service.swagger.json | 48 ++++++++++++++--------- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 3624dcf..f3a23a7 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,11 @@ PROTOC_INTERNAL := $(PROTOC) \ --csharp_out=internal_access,base_namespace:${PROTO_GEN_CSHARP_DIR} \ --python_out=${PROTO_GEN_PYTHON_DIR} -proto: +.PHONY: proto +proto: proto-prepare proto-api-v2 proto-api-v3 + +.PHONY: proto-prepare +proto-prepare: mkdir -p ${PROTO_GEN_GO_DIR} \ ${PROTO_GEN_JAVA_DIR} \ ${PROTO_GEN_PYTHON_DIR} \ @@ -99,14 +103,18 @@ proto: ${PROTO_GEN_CPP_DIR} \ ${PROTO_GEN_CSHARP_DIR} +.PHONY: proto-api-v2 +proto-api-v2: $(PROTOC_WITHOUT_GRPC) \ proto/api_v2/model.proto - + $(PROTOC_WITH_GRPC) \ proto/api_v2/query.proto \ proto/api_v2/collector.proto \ proto/api_v2/sampling.proto +.PHONY: proto-api-v3 +proto-api-v3: # API v3 $(PROTOC_WITH_GRPC) \ proto/api_v3/query_service.proto diff --git a/opentelemetry-proto b/opentelemetry-proto index c4dfbc5..4ca4f03 160000 --- a/opentelemetry-proto +++ b/opentelemetry-proto @@ -1 +1 @@ -Subproject commit c4dfbc51f3cd4089778555a2ac5d9bc093ed2956 +Subproject commit 4ca4f0335c63cda7ab31ea7ed70d6553aee14dce diff --git a/swagger/api_v3/query_service.swagger.json b/swagger/api_v3/query_service.swagger.json index fc9de98..45a9c95 100644 --- a/swagger/api_v3/query_service.swagger.json +++ b/swagger/api_v3/query_service.swagger.json @@ -72,13 +72,13 @@ "type": "object", "properties": { "result": { - "$ref": "#/definitions/api_v3SpansResponseChunk" + "$ref": "#/definitions/v1TracesData" }, "error": { "$ref": "#/definitions/runtimeStreamError" } }, - "title": "Stream result of api_v3SpansResponseChunk" + "title": "Stream result of v1TracesData" } } }, @@ -150,13 +150,13 @@ "type": "object", "properties": { "result": { - "$ref": "#/definitions/api_v3SpansResponseChunk" + "$ref": "#/definitions/v1TracesData" }, "error": { "$ref": "#/definitions/runtimeStreamError" } }, - "title": "Stream result of api_v3SpansResponseChunk" + "title": "Stream result of v1TracesData" } } }, @@ -247,6 +247,11 @@ "type": "integer", "format": "int64", "description": "dropped_attributes_count is the number of dropped attributes. If the value is 0,\nthen no attributes were dropped." + }, + "flags": { + "type": "integer", + "format": "int64", + "description": "Flags, a bit field. 8 least significant bits are the trace\nflags as defined in W3C Trace Context specification. Readers\nMUST not assume that 24 most significant bits will be zero.\nWhen creating new spans, the most-significant 24-bits MUST be\nzero. To read the 8-bit W3C trace flag (use flags \u0026\nSPAN_FLAGS_TRACE_FLAGS_MASK). [Optional].\n\nSee https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions." } }, "description": "A pointer from the current span to another span in the same trace or in a\ndifferent trace. For example, this can be used in batching operations,\nwhere a single batch handler processes multiple requests from different\ntraces or when the handler receives a request from a different project." @@ -311,19 +316,6 @@ }, "description": "Operation encapsulates information about operation." }, - "api_v3SpansResponseChunk": { - "type": "object", - "properties": { - "resource_spans": { - "type": "array", - "items": { - "$ref": "#/definitions/v1ResourceSpans" - }, - "title": "A list of OpenTelemetry ResourceSpans.\nIn case of JSON format the ids (trace_id, span_id, parent_id) are encoded in base64 even though OpenTelemetry specification\nmandates to use hex encoding [2].\nBase64 is chosen to keep compatibility with JSONPb codec.\n[1]: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto\n[2]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#otlphttp" - } - }, - "description": "Response object with spans." - }, "api_v3TraceQueryParameters": { "type": "object", "properties": { @@ -529,7 +521,7 @@ }, "schema_url": { "type": "string", - "description": "This schema_url applies to the data in the \"resource\" field. It does not apply\nto the data in the \"scope_spans\" field which have their own schema_url field." + "description": "The Schema URL, if known. This is the identifier of the Schema that the resource data\nis recorded in. To learn more about Schema URL see\nhttps://opentelemetry.io/docs/specs/otel/schemas/#schema-url\nThis schema_url applies to the data in the \"resource\" field. It does not apply\nto the data in the \"scope_spans\" field which have their own schema_url field." } }, "description": "A collection of ScopeSpans from a Resource." @@ -550,7 +542,7 @@ }, "schema_url": { "type": "string", - "description": "This schema_url applies to all spans and span events in the \"spans\" field." + "description": "The Schema URL, if known. This is the identifier of the Schema that the span data\nis recorded in. To learn more about Schema URL see\nhttps://opentelemetry.io/docs/specs/otel/schemas/#schema-url\nThis schema_url applies to all spans and span events in the \"spans\" field." } }, "description": "A collection of Spans produced by an InstrumentationScope." @@ -577,6 +569,11 @@ "format": "byte", "description": "The `span_id` of this span's parent span. If this is a root span, then this\nfield must be empty. The ID is an 8-byte array." }, + "flags": { + "type": "integer", + "format": "int64", + "description": "Flags, a bit field. 8 least significant bits are the trace\nflags as defined in W3C Trace Context specification. Readers\nMUST not assume that 24 most significant bits will be zero.\nTo read the 8-bit W3C trace flag, use `flags \u0026 SPAN_FLAGS_TRACE_FLAGS_MASK`.\n\nWhen creating span messages, if the message is logically forwarded from another source\nwith an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD\nbe copied as-is. If creating from a source that does not have an equivalent flags field\n(such as a runtime representation of an OpenTelemetry span), the high 24 bits MUST\nbe set to zero.\n\n[Optional].\n\nSee https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions." + }, "name": { "type": "string", "description": "A description of the span's operation.\n\nFor example, the name can be a qualified method name or a file name\nand a line number where the operation is called. A best practice is to use\nthe same display name at the same call point in an application.\nThis makes it easier to correlate spans in different traces.\n\nThis field is semantically required to be set to non-empty string.\nEmpty value is equivalent to an unknown span name.\n\nThis field is required." @@ -652,6 +649,19 @@ } }, "description": "The Status type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs." + }, + "v1TracesData": { + "type": "object", + "properties": { + "resource_spans": { + "type": "array", + "items": { + "$ref": "#/definitions/v1ResourceSpans" + }, + "description": "An array of ResourceSpans.\nFor data coming from a single resource this array will typically contain\none element. Intermediary nodes that receive data from multiple origins\ntypically batch the data before forwarding further and in that case this\narray will contain multiple elements." + } + }, + "description": "TracesData represents the traces data that can be stored in a persistent storage,\nOR can be embedded by other protocols that transfer OTLP traces data but do\nnot implement the OTLP protocol.\n\nThe main difference between this message and collector protocol is that\nin this message there will not be any \"control\" or \"metadata\" specific to\nOTLP protocol.\n\nWhen new fields are added into this message, the OTLP request MUST be updated\nas well." } } } From 29ed41a28a6543e7fa7aae08621cde38ed99408a Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 17 Nov 2024 01:25:22 -0500 Subject: [PATCH 2/3] Update Zipkin API (#110) ## Which problem is this PR solving? - Swagger Docker image is no longer value ## Description of the changes - Upgrade swagger image version to 0.31 - That fails on the old API definition for Zipkin, so update that from the latest ## How was this change tested? - CI --------- Signed-off-by: Yuri Shkuro --- Makefile | 2 +- swagger/zipkin2-api.yaml | 295 +++++++++++++++++++++++++++++---------- 2 files changed, 223 insertions(+), 74 deletions(-) diff --git a/Makefile b/Makefile index f3a23a7..da10c03 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ THRIFT_VER?=0.13 THRIFT_IMG?=jaegertracing/thrift:$(THRIFT_VER) THRIFT=docker run --rm -u $(shell id -u) -v "${PWD}:/data" $(THRIFT_IMG) thrift -SWAGGER_VER=0.12.0 +SWAGGER_VER=0.31.0 SWAGGER_IMAGE=quay.io/goswagger/swagger:$(SWAGGER_VER) SWAGGER=docker run --rm -u ${shell id -u} -v "${PWD}:/go/src/${PROJECT_ROOT}" -w /go/src/${PROJECT_ROOT} $(SWAGGER_IMAGE) diff --git a/swagger/zipkin2-api.yaml b/swagger/zipkin2-api.yaml index f97c3f1..7c7f183 100644 --- a/swagger/zipkin2-api.yaml +++ b/swagger/zipkin2-api.yaml @@ -1,9 +1,23 @@ +# Copyright 2018-2024 The OpenZipkin Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +# Source: https://zipkin.io/zipkin-api/zipkin2-api.yaml + swagger: "2.0" info: - version: "1.0.0" + version: "2" title: Zipkin API description: | - Zipkin's v2 api currently includes a POST endpoint that can receive spans. + Zipkin's v2 API currently includes a POST endpoint that can receive spans. host: localhost:9411 basePath: /api/v2 schemes: @@ -17,13 +31,13 @@ paths: description: | Returns a list of all service names associated with span endpoints. responses: - 200: - description: Succes + '200': + description: OK schema: type: array items: type: string - 400: + '400': description: Bad Request Error /spans: get: @@ -37,29 +51,27 @@ paths: graph. The /services endpoint enumerates possible input values. type: string responses: - 200: + '200': description: OK schema: - type: array - items: - type: string - 400: - description: Bad Request Error + $ref: "#/definitions/ListOfSpans" + '400': + description: Bad Request Error post: - description: | - Uploads a list of spans encoded per content-type, for example json. + summary: | + Uploads a list of spans encoded per content-type, for example json. consumes: - application/json - produces: [] + - application/x-protobuf parameters: - - name: spans - in: body + - in: body + name: spans description: A list of spans that belong to any trace. required: true schema: $ref: "#/definitions/ListOfSpans" responses: - 202: + '202': description: Accepted /traces: get: @@ -103,12 +115,14 @@ paths: - name: minDuration in: query type: integer + format: int64 description: | Ex. 100000 (for 100ms). Only return traces whose `Span.duration` is greater than or equal to minDuration microseconds. - name: maxDuration in: query type: integer + format: int64 description: | Only return traces whose Span.duration is less than or equal to `maxDuration` microseconds. Only valid with minDuration. @@ -134,7 +148,7 @@ paths: description: | Maximum number of traces to return. Defaults to 10 responses: - 200: + '200': description: OK schema: $ref: "#/definitions/ListOfTraces" @@ -147,19 +161,47 @@ paths: type: string maxLength: 32 minLength: 16 - pattern: "[a-z0-9]{16,32}" + pattern: "[a-f0-9]{16,32}" description: | Trace identifier, set on all spans within it. - + Encoded as 16 or 32 lowercase hex characters corresponding to 64 or 128 bits. For example, a 128bit trace ID looks like 4e441824ec2b6a44ffdc9bb9a6453df3 responses: - 200: + '200': description: OK schema: $ref: "#/definitions/Trace" - 404: + '404': description: "`traceId` not found" + /traceMany: + get: + description: | + Invoking this request retrieves any traces with the specified IDs. + + Results return in any order, and can be empty. + + Use /trace/{traceId} to request a single trace ID: <2 trace IDs is a + bad request. + parameters: + - name: traceIds + in: query + type: string + minLength: 33 + pattern: "([a-f0-9]{16,32},)+([a-f0-9]{16,32})" + required: true + description: | + Comma delimited list of at least two unique trace identifiers. + + Encoded as 16 or 32 lowercase hex characters corresponding to 64 or 128 bits. + For example, a 128bit trace ID looks like 4e441824ec2b6a44ffdc9bb9a6453df3 + responses: + '200': + description: OK. List of traces that match the input traceIds, empty if none match. + schema: + $ref: "#/definitions/ListOfTraces" + '400': + description: Bad request. Less than two traceIds, or the list was redundant or malformed. /dependencies: get: description: | @@ -182,13 +224,53 @@ paths: type: integer format: int64 responses: - 200: + '200': description: OK schema: type: array title: ListOfDependencyLinks items: $ref: "#/definitions/DependencyLink" + /autocompleteKeys: + get: + description: | + Returns a subset of keys from Span.tags configured for value autocompletion. + This helps sites populate common keys into the annotationQuery parameter of the + /traces endpoint. For example, a UI can allow users to select site-specific + keys from a drop-down as opposed to typing them in manually. This helps guide + users towards the more correct keys and avoids typos or formatting problems. + responses: + '200': + description: Success is a list of site-specific keys, such as environment. + schema: + type: array + items: + type: string + '400': + description: Bad Request Error + /autocompleteValues: + get: + description: | + Returns all known values of Span.tags for the given autocomplete key. Refer + to the description of /autocompleteKeys for the use case. + parameters: + - name: key + in: query + required: true + description: Name of the autocomplete key from the /autocompleteKeys endpoint. + type: string + responses: + '200': + description: | + Success result is empty when there are no values or the key was not + configured. + schema: + type: array + items: + type: string + '400': + description: Bad Request Error + definitions: Endpoint: type: object @@ -200,7 +282,7 @@ definitions: description: | Lower-case label of this node in the service graph, such as "favstar". Leave absent if unknown. - + This is a primary label for trace lookup and aggregation, so it should be intuitive and consistent. Many use a name from service discovery. ipv4: @@ -208,44 +290,48 @@ definitions: format: ipv4 description: | The text representation of the primary IPv4 address associated with this - a connection. Ex. 192.168.99.100 Absent if unknown. + connection. Ex. 192.168.99.100 Absent if unknown. ipv6: type: string format: ipv6 description: | - The text representation of the primary IPv6 address associated with this - a connection. Ex. 2001:db8::c001 Absent if unknown. - + The text representation of the primary IPv6 address associated with a + connection. Ex. 2001:db8::c001 Absent if unknown. + Prefer using the ipv4 field for mapped addresses. port: type: integer description: | Depending on context, this could be a listen port or the client-side of a - socket. Absent if unknown + socket. Absent if unknown. Please don't set to zero. Annotation: title: Annotation type: object description: | Associates an event that explains latency with a timestamp. Unlike log statements, annotations are often codes. Ex. "ws" for WireSend - + Zipkin v1 core annotations such as "cs" and "sr" have been replaced with Span.Kind, which interprets timestamp and duration. + required: + - timestamp + - value properties: timestamp: type: integer + format: int64 description: | Epoch **microseconds** of this event. - + For example, 1502787600000000 corresponds to 2017-08-15 09:00 UTC - + This value should be set directly by instrumentation, using the most precise value possible. For example, gettimeofday or multiplying epoch millis by 1000. value: type: string description: | Usually a short tag indicating an event, like "error" - + While possible to add larger data, such as garbage collection details, low cardinality event names both keep the size of spans down and also are easy to search against. @@ -254,7 +340,7 @@ definitions: title: Tags description: | Adds context to a span, for search, viewing and analysis. - + For example, a key "your_app.version" would let you lookup traces by version. A tag "sql.query" isn't searchable, but it can help in debugging when viewing a trace. @@ -276,9 +362,24 @@ definitions: title: ListOfTraces type: array items: - $ref: "#/definitions/Trace" + $ref: "#/definitions/Trace" Span: title: Span + description: | + A span is a single-host view of an operation. A trace is a series of spans + (often RPC calls) which nest to form a latency tree. Spans are in the same + trace when they share the same trace ID. The parent_id field establishes the + position of one span in the tree. + + The root span is where parent_id is Absent and usually has the longest + duration in the trace. However, nested asynchronous work can materialize as + child spans whose duration exceed the root span. + + Spans usually represent remote activity such as RPC calls, or messaging + producers and consumers. However, they can also represent in-process + activity in any position of the trace. For example, a root span could + represent a server receiving an initial client request. A root span could + also represent a scheduled job that has no remote context. type: object required: - traceId @@ -288,10 +389,10 @@ definitions: type: string maxLength: 32 minLength: 16 - pattern: "[a-z0-9]{16,32}" + pattern: "[a-f0-9]{16,32}" description: | Randomly generated, unique identifier for a trace, set on all spans within it. - + Encoded as 16 or 32 lowercase hex characters corresponding to 64 or 128 bits. For example, a 128bit trace ID looks like 4e441824ec2b6a44ffdc9bb9a6453df3 name: @@ -299,23 +400,23 @@ definitions: description: | The logical operation this span represents in lowercase (e.g. rpc method). Leave absent if unknown. - + As these are lookup labels, take care to ensure names are low cardinality. For example, do not embed variables into the name. parentId: type: string - pattern: "[a-z0-9]{16}" + pattern: "[a-f0-9]{16}" maxLength: 16 minLength: 16 description: 'The parent span ID or absent if this the root span in a trace.' id: type: string - pattern: "[a-z0-9]{16}" + pattern: "[a-f0-9]{16}" maxLength: 16 minLength: 16 description: | Unique 64bit identifier for this operation within the trace. - + Encoded as 16 lowercase hex characters. For example ffdc9bb9a6453df3 kind: type: string @@ -325,38 +426,40 @@ definitions: - PRODUCER - CONSUMER description: | - When present, clarifies timestamp, duration and remoteEndpoint. When - absent, the span is local or incomplete. Unlike client and server, - there is no direct critical path latency relationship between producer - and consumer spans. - + When present, kind clarifies timestamp, duration and remoteEndpoint. When + absent, the span is local or incomplete. Unlike client and server, there + is no direct critical path latency relationship between producer and + consumer spans. + * `CLIENT` - * timestamp - The moment a request was sent (formerly "cs") - * duration - When present indicates when a response was received (formerly "cr") - * remoteEndpoint - Represents the server. Leave serviceName absent if unknown. + * timestamp is the moment a request was sent to the server. (in v1 "cs") + * duration is the delay until a response or an error was received. (in v1 "cr"-"cs") + * remoteEndpoint is the server. (in v1 "sa") * `SERVER` - * timestamp - The moment a request was received (formerly "sr") - * duration - When present indicates when a response was sent (formerly "ss") - * remoteEndpoint - Represents the client. Leave serviceName absent if unknown. + * timestamp is the moment a client request was received. (in v1 "sr") + * duration is the delay until a response was sent or an error. (in v1 "ss"-"sr") + * remoteEndpoint is the client. (in v1 "ca") * `PRODUCER` - * timestamp - The moment a message was sent to a destination (formerly "ms") - * duration - When present represents delay sending the message, such as batching. - * remoteEndpoint - Represents the broker. Leave serviceName absent if unknown. + * timestamp is the moment a message was sent to a destination. (in v1 "ms") + * duration is the delay sending the message, such as batching. + * remoteEndpoint is the broker. * `CONSUMER` - * timestamp - The moment a message was received from an origin (formerly "mr") - * duration - When present represents delay consuming the message, such as from backlog. + * timestamp is the moment a message was received from an origin. (in v1 "mr") + * duration is the delay consuming the message, such as from backlog. * remoteEndpoint - Represents the broker. Leave serviceName absent if unknown. timestamp: type: integer format: int64 description: | - Epoch **microseconds** of the start of this span, possibly absent if incomplete. - + Epoch microseconds of the start of this span, possibly absent if + incomplete. + For example, 1502787600000000 corresponds to 2017-08-15 09:00 UTC - - This value should be set directly by instrumentation, using the most precise - value possible. For example, gettimeofday or multiplying epoch millis by 1000. - + + This value should be set directly by instrumentation, using the most + precise value possible. For example, gettimeofday or multiplying epoch + millis by 1000. + There are three known edge-cases where this could be reported absent. * A span was allocated but never started (ex not yet received a timestamp) * The span's start event was lost @@ -367,15 +470,15 @@ definitions: minimum: 1 description: | Duration in **microseconds** of the critical path, if known. Durations of less - than one are rounded up. Duration of children can be longer than their parents - due to asynchronous operations. - + than one are rounded up. Duration of children can be longer than their + parents due to asynchronous operations. + For example 150 milliseconds is 150000 microseconds. debug: type: boolean description: | True is a request to store this span even if it overrides sampling policy. - + This is true when the `X-B3-Flags` header has a value of 1. shared: type: boolean @@ -384,14 +487,21 @@ definitions: $ref: "#/definitions/Endpoint" description: | The host that recorded this span, primarily for query by service name. - - Instrumentation should always record this. Usually, absent implies late data. - The IP address corresponding to this is usually the site local or advertised - service address. When present, the port indicates the listen port. + + Instrumentation should always record this. Usually, absent implies late + data. The IP address corresponding to this is usually the site local or + advertised service address. When present, the port indicates the listen + port. remoteEndpoint: $ref: "#/definitions/Endpoint" description: | - When an RPC (or messaging) span, indicates the other side of the connection. + When an RPC (or messaging) span, indicates the other side of the + connection. + + By recording the remote endpoint, your trace will contain network context + even if the peer is not tracing. For example, you can record the IP from + the `X-Forwarded-For` header or the service name and socket of a remote + peer. annotations: type: array uniqueItems: true @@ -401,15 +511,54 @@ definitions: tags: $ref: '#/definitions/Tags' description: 'Tags give your span context for search, viewing and analysis.' + example: + id: "352bff9a74ca9ad2" + traceId: "5af7183fb1d4cf5f" + parentId: "6b221d5bc9e6496c" + name: "get /api" + timestamp: 1556604172355737 + duration: 1431 + kind: "SERVER" + localEndpoint: + serviceName: "backend" + ipv4: "192.168.99.1" + port: 3306 + remoteEndpoint: + ipv4: "172.19.0.2" + port: 58648 + tags: + http.method: "GET" + http.path: "/api" DependencyLink: title: DependencyLink + description: | + The count of traced calls between services, or between a service and a broker. + + The direction of the link is parent to child, and can be one of: + * client to server + * producer to broker + * broker to consumer + + Note: This is related to span ID count between a sender and receiver, but there + is nuance that makes it more difficult than counting unique span IDs. Ex. the + parent or child might be uninstrumented: detected via the remote endpoint. There + can also be scenarios where both sides are instrumented. Please use existing tools + such as zipkin-dependencies to derive links as they avoid under or over counting. type: object + required: + - parent + - child + - callCount properties: parent: type: string + description: 'The service name of the caller: client or message producer or broker.' child: type: string + description: 'The service name of the callee: server or message consumer or broker.' callCount: type: integer + description: 'Total traced calls made from the parent to the child.' errorCount: - type: integer \ No newline at end of file + type: integer + description: 'Total traced calls made from the parent to the child known to be in error.' From 7728794957b99056be3a28e6e525e79bf8b353bd Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 17 Nov 2024 16:42:01 -0500 Subject: [PATCH 3/3] Change start/end time to non-nullable (#109) ## Which problem is this PR solving? - Part of https://github.com/jaegertracing/jaeger/issues/4150 ## Description of the changes - Make time values non-nullable to avoid pointers ## How was this change tested? - In https://github.com/jaegertracing/jaeger/pull/6218 --------- Signed-off-by: Yuri Shkuro --- Makefile | 4 +++- proto/api_v2/query.proto | 6 ++++-- proto/api_v3/query_service.proto | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index da10c03..ebe619d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ +# Copyright (c) 2023 The Jaeger Authors. +# SPDX-License-Identifier: Apache-2.0 -THRIFT_VER?=0.13 +THRIFT_VER?=0.19 THRIFT_IMG?=jaegertracing/thrift:$(THRIFT_VER) THRIFT=docker run --rm -u $(shell id -u) -v "${PWD}:/data" $(THRIFT_IMG) thrift diff --git a/proto/api_v2/query.proto b/proto/api_v2/query.proto index 43c4969..7c69b3a 100644 --- a/proto/api_v2/query.proto +++ b/proto/api_v2/query.proto @@ -42,11 +42,13 @@ message GetTraceRequest { ]; // Optional. The start time to search trace ID. google.protobuf.Timestamp start_time = 2 [ - (gogoproto.stdtime) = true + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false ]; // Optional. The end time to search trace ID. google.protobuf.Timestamp end_time = 3 [ - (gogoproto.stdtime) = true + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false ]; } diff --git a/proto/api_v3/query_service.proto b/proto/api_v3/query_service.proto index 61feed0..ebf125e 100644 --- a/proto/api_v3/query_service.proto +++ b/proto/api_v3/query_service.proto @@ -30,11 +30,13 @@ message GetTraceRequest { string trace_id = 1; // Optional. The start time to search trace ID. google.protobuf.Timestamp start_time = 2 [ - (gogoproto.stdtime) = true + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false ]; // Optional. The end time to search trace ID. google.protobuf.Timestamp end_time = 3 [ - (gogoproto.stdtime) = true + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false ]; }