diff --git a/CHANGELOG.md b/CHANGELOG.md index 28ac4d63d..b8c70a1d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan - [#1](https://github.com/kobsio/kobs/pull/1): Fix mobile layout for the cluster and namespace filter by using a Toolbar instead of FlexItems. - [#9](https://github.com/kobsio/kobs/pull/9): Fix time parsing for the datasource options. +- [#14](https://github.com/kobsio/kobs/pull/14): Fix loading of Jaeger services, when a user opend the Jaeger plugin, where the `service` query parameter was already present. ### Changed diff --git a/app/src/plugins/jaeger/JaegerPageToolbar.tsx b/app/src/plugins/jaeger/JaegerPageToolbar.tsx index 2b98b30c1..07c1380b8 100644 --- a/app/src/plugins/jaeger/JaegerPageToolbar.tsx +++ b/app/src/plugins/jaeger/JaegerPageToolbar.tsx @@ -15,7 +15,13 @@ import React, { useCallback, useEffect, useState } from 'react'; import FilterIcon from '@patternfly/react-icons/dist/js/icons/filter-icon'; import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon'; -import { GetOperationsRequest, GetOperationsResponse, JaegerPromiseClient } from 'proto/jaeger_grpc_web_pb'; +import { + GetOperationsRequest, + GetOperationsResponse, + GetServicesRequest, + GetServicesResponse, + JaegerPromiseClient, +} from 'proto/jaeger_grpc_web_pb'; import Options, { IAdditionalFields } from 'components/Options'; import { IJaegerOptions } from 'plugins/jaeger/helpers'; import JaegerPageToolbarSelect from 'plugins/jaeger/JaegerPageToolbarSelect'; @@ -82,23 +88,36 @@ const JaegerPageToolbar: React.FunctionComponent = ({ } }; - // fetchOperations is used to retrieve the operations for the given service or if no service is specified also a list - // of services. + // fetchServices is used to retrieve the services from Jaeger. + const fetchServices = useCallback(async (): Promise => { + try { + const getServicesRequest = new GetServicesRequest(); + getServicesRequest.setName(name); + + const getServicesResponse: GetServicesResponse = await jaegerService.getServices(getServicesRequest, null); + const { servicesList } = getServicesResponse.toObject(); + + setData({ error: '', operations: [], services: servicesList }); + } catch (err) { + setData({ error: err.message, operations: [], services: [] }); + } + }, [name]); + + // fetchOperations is used to retrieve the operations for the given service. We only can fetch the operations, when a + // user has selected an service. const fetchOperations = useCallback(async (): Promise => { try { - const getOperationsRequest = new GetOperationsRequest(); - getOperationsRequest.setName(name); - getOperationsRequest.setService(options.service); - - const getOperationsResponse: GetOperationsResponse = await jaegerService.getOperations( - getOperationsRequest, - null, - ); - const { servicesList, operationsList } = getOperationsResponse.toObject(); - - if (servicesList.length > 0) { - setData({ error: '', operations: operationsList.map((operation) => operation.name), services: servicesList }); - } else { + if (options.service !== '') { + const getOperationsRequest = new GetOperationsRequest(); + getOperationsRequest.setName(name); + getOperationsRequest.setService(options.service); + + const getOperationsResponse: GetOperationsResponse = await jaegerService.getOperations( + getOperationsRequest, + null, + ); + const { operationsList } = getOperationsResponse.toObject(); + setData((d) => { return { ...d, error: '', operations: operationsList.map((operation) => operation.name) }; }); @@ -108,7 +127,12 @@ const JaegerPageToolbar: React.FunctionComponent = ({ } }, [name, options.service]); - // useEffect is used to call the fetchOperations function everytime the Jaeger the service is changed are changed. + // useEffect is used to call the fetchServices function. + useEffect(() => { + fetchServices(); + }, [fetchServices]); + + // useEffect is used to call the fetchOperations function everytime the Jaeger service is changed are changed. useEffect(() => { fetchOperations(); }, [fetchOperations]); @@ -137,6 +161,7 @@ const JaegerPageToolbar: React.FunctionComponent = ({ = ({ setOptions({ ...options, operation: item })} + selectItem={(item: string): void => + setOptions({ ...options, operation: item === 'All Operations' ? '' : item }) + } /> Tags diff --git a/app/src/plugins/jaeger/JaegerPageToolbarSelect.tsx b/app/src/plugins/jaeger/JaegerPageToolbarSelect.tsx index 1e56a0b5b..e526cac0f 100644 --- a/app/src/plugins/jaeger/JaegerPageToolbarSelect.tsx +++ b/app/src/plugins/jaeger/JaegerPageToolbarSelect.tsx @@ -2,14 +2,19 @@ import React, { useState } from 'react'; import { Select, SelectOption, SelectOptionObject, SelectVariant } from '@patternfly/react-core'; interface IJaegerPageToolbarSelectProps { + isOperations: boolean; placeholder: string; items: string[]; selectedItem: string; selectItem: (item: string) => void; } -// JaegerPageToolbarSelect provides a select box for the services and operations for Jaeger. +// JaegerPageToolbarSelect provides a select box for the services and operations for Jaeger. The "isOperations" value is +// needed to provide a special handling, when the user doesn't want to specify an operation, but has selected one +// already. For that we have the special 'All Operations' handling, which is only used within this component. If the +// user selects this item, the selectItem function in the parent component will ignore it. const JaegerPageToolbarSelect: React.FunctionComponent = ({ + isOperations, placeholder, items, selectedItem, @@ -27,6 +32,14 @@ const JaegerPageToolbarSelect: React.FunctionComponent 0 + ? [ + , + ...items.map((item, index) => ), + ] + : items.map((item, index) => ); + return ( ); }; diff --git a/app/src/plugins/jaeger/JaegerSpanLogs.tsx b/app/src/plugins/jaeger/JaegerSpanLogs.tsx index 50eff2295..c89f08899 100644 --- a/app/src/plugins/jaeger/JaegerSpanLogs.tsx +++ b/app/src/plugins/jaeger/JaegerSpanLogs.tsx @@ -28,7 +28,7 @@ const JaegerSpanLogs: React.FunctionComponent = ({ logs }: isExpanded={expanded.includes(`logs-accordion-${index}`)} id={`resources-toggle-${index}`} > - {formatTraceTime(log.timestamp)} () + {formatTraceTime(log.timestamp)} } + */ +const methodDescriptor_Jaeger_GetServices = new grpc.web.MethodDescriptor( + '/plugins.jaeger.Jaeger/GetServices', + grpc.web.MethodType.UNARY, + proto.plugins.jaeger.GetServicesRequest, + proto.plugins.jaeger.GetServicesResponse, + /** + * @param {!proto.plugins.jaeger.GetServicesRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.plugins.jaeger.GetServicesResponse.deserializeBinary +); + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.plugins.jaeger.GetServicesRequest, + * !proto.plugins.jaeger.GetServicesResponse>} + */ +const methodInfo_Jaeger_GetServices = new grpc.web.AbstractClientBase.MethodInfo( + proto.plugins.jaeger.GetServicesResponse, + /** + * @param {!proto.plugins.jaeger.GetServicesRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.plugins.jaeger.GetServicesResponse.deserializeBinary +); + + +/** + * @param {!proto.plugins.jaeger.GetServicesRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.plugins.jaeger.GetServicesResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.plugins.jaeger.JaegerClient.prototype.getServices = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/plugins.jaeger.Jaeger/GetServices', + request, + metadata || {}, + methodDescriptor_Jaeger_GetServices, + callback); +}; + + +/** + * @param {!proto.plugins.jaeger.GetServicesRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.plugins.jaeger.JaegerPromiseClient.prototype.getServices = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/plugins.jaeger.Jaeger/GetServices', + request, + metadata || {}, + methodDescriptor_Jaeger_GetServices); +}; + + /** * @const * @type {!grpc.web.MethodDescriptor< diff --git a/app/src/proto/jaeger_pb.d.ts b/app/src/proto/jaeger_pb.d.ts index 38184290a..b77c541d9 100644 --- a/app/src/proto/jaeger_pb.d.ts +++ b/app/src/proto/jaeger_pb.d.ts @@ -3,6 +3,48 @@ import * as jspb from "google-protobuf"; +export class GetServicesRequest extends jspb.Message { + getName(): string; + setName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetServicesRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetServicesRequest): GetServicesRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetServicesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetServicesRequest; + static deserializeBinaryFromReader(message: GetServicesRequest, reader: jspb.BinaryReader): GetServicesRequest; +} + +export namespace GetServicesRequest { + export type AsObject = { + name: string, + } +} + +export class GetServicesResponse extends jspb.Message { + clearServicesList(): void; + getServicesList(): Array; + setServicesList(value: Array): void; + addServices(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetServicesResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetServicesResponse): GetServicesResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetServicesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetServicesResponse; + static deserializeBinaryFromReader(message: GetServicesResponse, reader: jspb.BinaryReader): GetServicesResponse; +} + +export namespace GetServicesResponse { + export type AsObject = { + servicesList: Array, + } +} + export class GetOperationsRequest extends jspb.Message { getName(): string; setName(value: string): void; @@ -28,11 +70,6 @@ export namespace GetOperationsRequest { } export class GetOperationsResponse extends jspb.Message { - clearServicesList(): void; - getServicesList(): Array; - setServicesList(value: Array): void; - addServices(value: string, index?: number): string; - clearOperationsList(): void; getOperationsList(): Array; setOperationsList(value: Array): void; @@ -50,7 +87,6 @@ export class GetOperationsResponse extends jspb.Message { export namespace GetOperationsResponse { export type AsObject = { - servicesList: Array, operationsList: Array, } } diff --git a/app/src/proto/jaeger_pb.js b/app/src/proto/jaeger_pb.js index fb400dee6..6e70ae3e0 100644 --- a/app/src/proto/jaeger_pb.js +++ b/app/src/proto/jaeger_pb.js @@ -16,6 +16,8 @@ var global = Function('return this')(); goog.exportSymbol('proto.plugins.jaeger.GetOperationsRequest', null, global); goog.exportSymbol('proto.plugins.jaeger.GetOperationsResponse', null, global); +goog.exportSymbol('proto.plugins.jaeger.GetServicesRequest', null, global); +goog.exportSymbol('proto.plugins.jaeger.GetServicesResponse', null, global); goog.exportSymbol('proto.plugins.jaeger.GetTraceRequest', null, global); goog.exportSymbol('proto.plugins.jaeger.GetTraceResponse', null, global); goog.exportSymbol('proto.plugins.jaeger.GetTracesRequest', null, global); @@ -23,6 +25,48 @@ goog.exportSymbol('proto.plugins.jaeger.GetTracesResponse', null, global); goog.exportSymbol('proto.plugins.jaeger.Operation', null, global); goog.exportSymbol('proto.plugins.jaeger.Query', null, global); goog.exportSymbol('proto.plugins.jaeger.Spec', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.plugins.jaeger.GetServicesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.plugins.jaeger.GetServicesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.plugins.jaeger.GetServicesRequest.displayName = 'proto.plugins.jaeger.GetServicesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.plugins.jaeger.GetServicesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.plugins.jaeger.GetServicesResponse.repeatedFields_, null); +}; +goog.inherits(proto.plugins.jaeger.GetServicesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.plugins.jaeger.GetServicesResponse.displayName = 'proto.plugins.jaeger.GetServicesResponse'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -215,6 +259,292 @@ if (goog.DEBUG && !COMPILED) { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.plugins.jaeger.GetServicesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.plugins.jaeger.GetServicesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.plugins.jaeger.GetServicesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.plugins.jaeger.GetServicesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.plugins.jaeger.GetServicesRequest} + */ +proto.plugins.jaeger.GetServicesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.plugins.jaeger.GetServicesRequest; + return proto.plugins.jaeger.GetServicesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.plugins.jaeger.GetServicesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.plugins.jaeger.GetServicesRequest} + */ +proto.plugins.jaeger.GetServicesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.plugins.jaeger.GetServicesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.plugins.jaeger.GetServicesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.plugins.jaeger.GetServicesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.plugins.jaeger.GetServicesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.plugins.jaeger.GetServicesRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.plugins.jaeger.GetServicesRequest} returns this + */ +proto.plugins.jaeger.GetServicesRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.plugins.jaeger.GetServicesResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.plugins.jaeger.GetServicesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.plugins.jaeger.GetServicesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.plugins.jaeger.GetServicesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.plugins.jaeger.GetServicesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + servicesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.plugins.jaeger.GetServicesResponse} + */ +proto.plugins.jaeger.GetServicesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.plugins.jaeger.GetServicesResponse; + return proto.plugins.jaeger.GetServicesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.plugins.jaeger.GetServicesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.plugins.jaeger.GetServicesResponse} + */ +proto.plugins.jaeger.GetServicesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addServices(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.plugins.jaeger.GetServicesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.plugins.jaeger.GetServicesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.plugins.jaeger.GetServicesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.plugins.jaeger.GetServicesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getServicesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string services = 1; + * @return {!Array} + */ +proto.plugins.jaeger.GetServicesResponse.prototype.getServicesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.plugins.jaeger.GetServicesResponse} returns this + */ +proto.plugins.jaeger.GetServicesResponse.prototype.setServicesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.plugins.jaeger.GetServicesResponse} returns this + */ +proto.plugins.jaeger.GetServicesResponse.prototype.addServices = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.plugins.jaeger.GetServicesResponse} returns this + */ +proto.plugins.jaeger.GetServicesResponse.prototype.clearServicesList = function() { + return this.setServicesList([]); +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -378,7 +708,7 @@ proto.plugins.jaeger.GetOperationsRequest.prototype.setService = function(value) * @private {!Array} * @const */ -proto.plugins.jaeger.GetOperationsResponse.repeatedFields_ = [1,2]; +proto.plugins.jaeger.GetOperationsResponse.repeatedFields_ = [2]; @@ -411,7 +741,6 @@ proto.plugins.jaeger.GetOperationsResponse.prototype.toObject = function(opt_inc */ proto.plugins.jaeger.GetOperationsResponse.toObject = function(includeInstance, msg) { var f, obj = { - servicesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, operationsList: jspb.Message.toObjectList(msg.getOperationsList(), proto.plugins.jaeger.Operation.toObject, includeInstance) }; @@ -450,10 +779,6 @@ proto.plugins.jaeger.GetOperationsResponse.deserializeBinaryFromReader = functio } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.addServices(value); - break; case 2: var value = new proto.plugins.jaeger.Operation; reader.readMessage(value,proto.plugins.jaeger.Operation.deserializeBinaryFromReader); @@ -488,13 +813,6 @@ proto.plugins.jaeger.GetOperationsResponse.prototype.serializeBinary = function( */ proto.plugins.jaeger.GetOperationsResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getServicesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } f = message.getOperationsList(); if (f.length > 0) { writer.writeRepeatedMessage( @@ -506,43 +824,6 @@ proto.plugins.jaeger.GetOperationsResponse.serializeBinaryToWriter = function(me }; -/** - * repeated string services = 1; - * @return {!Array} - */ -proto.plugins.jaeger.GetOperationsResponse.prototype.getServicesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.plugins.jaeger.GetOperationsResponse} returns this - */ -proto.plugins.jaeger.GetOperationsResponse.prototype.setServicesList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.plugins.jaeger.GetOperationsResponse} returns this - */ -proto.plugins.jaeger.GetOperationsResponse.prototype.addServices = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.plugins.jaeger.GetOperationsResponse} returns this - */ -proto.plugins.jaeger.GetOperationsResponse.prototype.clearServicesList = function() { - return this.setServicesList([]); -}; - - /** * repeated Operation operations = 2; * @return {!Array} diff --git a/app/src/proto/jaeger_pb_service.d.ts b/app/src/proto/jaeger_pb_service.d.ts index 6440d7629..bdacdbd28 100644 --- a/app/src/proto/jaeger_pb_service.d.ts +++ b/app/src/proto/jaeger_pb_service.d.ts @@ -4,6 +4,15 @@ import * as jaeger_pb from "./jaeger_pb"; import {grpc} from "@improbable-eng/grpc-web"; +type JaegerGetServices = { + readonly methodName: string; + readonly service: typeof Jaeger; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof jaeger_pb.GetServicesRequest; + readonly responseType: typeof jaeger_pb.GetServicesResponse; +}; + type JaegerGetOperations = { readonly methodName: string; readonly service: typeof Jaeger; @@ -33,6 +42,7 @@ type JaegerGetTrace = { export class Jaeger { static readonly serviceName: string; + static readonly GetServices: JaegerGetServices; static readonly GetOperations: JaegerGetOperations; static readonly GetTraces: JaegerGetTraces; static readonly GetTrace: JaegerGetTrace; @@ -70,6 +80,15 @@ export class JaegerClient { readonly serviceHost: string; constructor(serviceHost: string, options?: grpc.RpcOptions); + getServices( + requestMessage: jaeger_pb.GetServicesRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: jaeger_pb.GetServicesResponse|null) => void + ): UnaryResponse; + getServices( + requestMessage: jaeger_pb.GetServicesRequest, + callback: (error: ServiceError|null, responseMessage: jaeger_pb.GetServicesResponse|null) => void + ): UnaryResponse; getOperations( requestMessage: jaeger_pb.GetOperationsRequest, metadata: grpc.Metadata, diff --git a/app/src/proto/jaeger_pb_service.js b/app/src/proto/jaeger_pb_service.js index 2108566cf..952c94dd9 100644 --- a/app/src/proto/jaeger_pb_service.js +++ b/app/src/proto/jaeger_pb_service.js @@ -10,6 +10,15 @@ var Jaeger = (function () { return Jaeger; }()); +Jaeger.GetServices = { + methodName: "GetServices", + service: Jaeger, + requestStream: false, + responseStream: false, + requestType: jaeger_pb.GetServicesRequest, + responseType: jaeger_pb.GetServicesResponse +}; + Jaeger.GetOperations = { methodName: "GetOperations", service: Jaeger, @@ -44,6 +53,37 @@ function JaegerClient(serviceHost, options) { this.options = options || {}; } +JaegerClient.prototype.getServices = function getServices(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Jaeger.GetServices, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + JaegerClient.prototype.getOperations = function getOperations(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; diff --git a/pkg/api/plugins/jaeger/jaeger.go b/pkg/api/plugins/jaeger/jaeger.go index bccd8ce32..48e9aa771 100644 --- a/pkg/api/plugins/jaeger/jaeger.go +++ b/pkg/api/plugins/jaeger/jaeger.go @@ -105,41 +105,53 @@ func (j *Jaeger) getInstace(name string) *Instance { return nil } -func (j *Jaeger) GetOperations(ctx context.Context, getOperationsRequest *jaegerProto.GetOperationsRequest) (*jaegerProto.GetOperationsResponse, error) { - if getOperationsRequest == nil { +func (j *Jaeger) GetServices(ctx context.Context, getServicesRequest *jaegerProto.GetServicesRequest) (*jaegerProto.GetServicesResponse, error) { + if getServicesRequest == nil { return nil, fmt.Errorf("request data is missing") } - instance := j.getInstace(getOperationsRequest.Name) + instance := j.getInstace(getServicesRequest.Name) if instance == nil { return nil, fmt.Errorf("invalid name for Jaeger plugin") } - log.WithFields(logrus.Fields{"service": getOperationsRequest.Service}).Tracef("GetOperations") + log.Tracef("GetServices") - var services []string - var service string - if getOperationsRequest.Service == "" { - body, err := instance.doRequest("/api/services") - if err != nil { - return nil, err - } + body, err := instance.doRequest("/api/services") + if err != nil { + return nil, err + } - var response ResponseDataServices - err = json.Unmarshal(body, &response) - if err != nil { - return nil, err - } + var response ResponseDataServices + err = json.Unmarshal(body, &response) + if err != nil { + return nil, err + } - services = response.Data - service = services[0] + log.WithFields(logrus.Fields{"count": len(response.Data)}).Tracef("GetServices retrieved services") - log.WithFields(logrus.Fields{"count": len(services)}).Tracef("GetOperations retrieved services") - } else { - service = getOperationsRequest.Service + return &jaegerProto.GetServicesResponse{ + Services: response.Data, + }, nil +} + +func (j *Jaeger) GetOperations(ctx context.Context, getOperationsRequest *jaegerProto.GetOperationsRequest) (*jaegerProto.GetOperationsResponse, error) { + if getOperationsRequest == nil { + return nil, fmt.Errorf("request data is missing") } - body, err := instance.doRequest(fmt.Sprintf("/api/operations?service=%s", service)) + instance := j.getInstace(getOperationsRequest.Name) + if instance == nil { + return nil, fmt.Errorf("invalid name for Jaeger plugin") + } + + if getOperationsRequest.Service == "" { + return nil, fmt.Errorf("serivce is missing") + } + + log.WithFields(logrus.Fields{"service": getOperationsRequest.Service}).Tracef("GetOperations") + + body, err := instance.doRequest(fmt.Sprintf("/api/operations?service=%s", getOperationsRequest.Service)) if err != nil { return nil, err } @@ -153,7 +165,6 @@ func (j *Jaeger) GetOperations(ctx context.Context, getOperationsRequest *jaeger log.WithFields(logrus.Fields{"count": len(response.Data)}).Tracef("GetOperations retrieved operations") return &jaegerProto.GetOperationsResponse{ - Services: services, Operations: response.Data, }, nil } diff --git a/pkg/api/plugins/jaeger/proto/jaeger.pb.go b/pkg/api/plugins/jaeger/proto/jaeger.pb.go index 1de7a8f55..d7d6975b3 100644 --- a/pkg/api/plugins/jaeger/proto/jaeger.pb.go +++ b/pkg/api/plugins/jaeger/proto/jaeger.pb.go @@ -25,6 +25,100 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 +type GetServicesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetServicesRequest) Reset() { + *x = GetServicesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_jaeger_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetServicesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetServicesRequest) ProtoMessage() {} + +func (x *GetServicesRequest) ProtoReflect() protoreflect.Message { + mi := &file_jaeger_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetServicesRequest.ProtoReflect.Descriptor instead. +func (*GetServicesRequest) Descriptor() ([]byte, []int) { + return file_jaeger_proto_rawDescGZIP(), []int{0} +} + +func (x *GetServicesRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetServicesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` +} + +func (x *GetServicesResponse) Reset() { + *x = GetServicesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_jaeger_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetServicesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetServicesResponse) ProtoMessage() {} + +func (x *GetServicesResponse) ProtoReflect() protoreflect.Message { + mi := &file_jaeger_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetServicesResponse.ProtoReflect.Descriptor instead. +func (*GetServicesResponse) Descriptor() ([]byte, []int) { + return file_jaeger_proto_rawDescGZIP(), []int{1} +} + +func (x *GetServicesResponse) GetServices() []string { + if x != nil { + return x.Services + } + return nil +} + type GetOperationsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -37,7 +131,7 @@ type GetOperationsRequest struct { func (x *GetOperationsRequest) Reset() { *x = GetOperationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[0] + mi := &file_jaeger_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -50,7 +144,7 @@ func (x *GetOperationsRequest) String() string { func (*GetOperationsRequest) ProtoMessage() {} func (x *GetOperationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[0] + mi := &file_jaeger_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -63,7 +157,7 @@ func (x *GetOperationsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetOperationsRequest.ProtoReflect.Descriptor instead. func (*GetOperationsRequest) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{0} + return file_jaeger_proto_rawDescGZIP(), []int{2} } func (x *GetOperationsRequest) GetName() string { @@ -85,14 +179,13 @@ type GetOperationsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` Operations []*Operation `protobuf:"bytes,2,rep,name=operations,proto3" json:"operations,omitempty"` } func (x *GetOperationsResponse) Reset() { *x = GetOperationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[1] + mi := &file_jaeger_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -105,7 +198,7 @@ func (x *GetOperationsResponse) String() string { func (*GetOperationsResponse) ProtoMessage() {} func (x *GetOperationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[1] + mi := &file_jaeger_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -118,14 +211,7 @@ func (x *GetOperationsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetOperationsResponse.ProtoReflect.Descriptor instead. func (*GetOperationsResponse) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{1} -} - -func (x *GetOperationsResponse) GetServices() []string { - if x != nil { - return x.Services - } - return nil + return file_jaeger_proto_rawDescGZIP(), []int{3} } func (x *GetOperationsResponse) GetOperations() []*Operation { @@ -154,7 +240,7 @@ type GetTracesRequest struct { func (x *GetTracesRequest) Reset() { *x = GetTracesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[2] + mi := &file_jaeger_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -167,7 +253,7 @@ func (x *GetTracesRequest) String() string { func (*GetTracesRequest) ProtoMessage() {} func (x *GetTracesRequest) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[2] + mi := &file_jaeger_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -180,7 +266,7 @@ func (x *GetTracesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTracesRequest.ProtoReflect.Descriptor instead. func (*GetTracesRequest) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{2} + return file_jaeger_proto_rawDescGZIP(), []int{4} } func (x *GetTracesRequest) GetName() string { @@ -257,7 +343,7 @@ type GetTracesResponse struct { func (x *GetTracesResponse) Reset() { *x = GetTracesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[3] + mi := &file_jaeger_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -270,7 +356,7 @@ func (x *GetTracesResponse) String() string { func (*GetTracesResponse) ProtoMessage() {} func (x *GetTracesResponse) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[3] + mi := &file_jaeger_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -283,7 +369,7 @@ func (x *GetTracesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTracesResponse.ProtoReflect.Descriptor instead. func (*GetTracesResponse) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{3} + return file_jaeger_proto_rawDescGZIP(), []int{5} } func (x *GetTracesResponse) GetTraces() string { @@ -305,7 +391,7 @@ type GetTraceRequest struct { func (x *GetTraceRequest) Reset() { *x = GetTraceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[4] + mi := &file_jaeger_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -318,7 +404,7 @@ func (x *GetTraceRequest) String() string { func (*GetTraceRequest) ProtoMessage() {} func (x *GetTraceRequest) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[4] + mi := &file_jaeger_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -331,7 +417,7 @@ func (x *GetTraceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTraceRequest.ProtoReflect.Descriptor instead. func (*GetTraceRequest) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{4} + return file_jaeger_proto_rawDescGZIP(), []int{6} } func (x *GetTraceRequest) GetName() string { @@ -359,7 +445,7 @@ type GetTraceResponse struct { func (x *GetTraceResponse) Reset() { *x = GetTraceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[5] + mi := &file_jaeger_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -372,7 +458,7 @@ func (x *GetTraceResponse) String() string { func (*GetTraceResponse) ProtoMessage() {} func (x *GetTraceResponse) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[5] + mi := &file_jaeger_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -385,7 +471,7 @@ func (x *GetTraceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTraceResponse.ProtoReflect.Descriptor instead. func (*GetTraceResponse) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{5} + return file_jaeger_proto_rawDescGZIP(), []int{7} } func (x *GetTraceResponse) GetTraces() string { @@ -407,7 +493,7 @@ type Operation struct { func (x *Operation) Reset() { *x = Operation{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[6] + mi := &file_jaeger_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -420,7 +506,7 @@ func (x *Operation) String() string { func (*Operation) ProtoMessage() {} func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[6] + mi := &file_jaeger_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -433,7 +519,7 @@ func (x *Operation) ProtoReflect() protoreflect.Message { // Deprecated: Use Operation.ProtoReflect.Descriptor instead. func (*Operation) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{6} + return file_jaeger_proto_rawDescGZIP(), []int{8} } func (x *Operation) GetName() string { @@ -461,7 +547,7 @@ type Spec struct { func (x *Spec) Reset() { *x = Spec{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[7] + mi := &file_jaeger_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -474,7 +560,7 @@ func (x *Spec) String() string { func (*Spec) ProtoMessage() {} func (x *Spec) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[7] + mi := &file_jaeger_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -487,7 +573,7 @@ func (x *Spec) ProtoReflect() protoreflect.Message { // Deprecated: Use Spec.ProtoReflect.Descriptor instead. func (*Spec) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{7} + return file_jaeger_proto_rawDescGZIP(), []int{9} } func (x *Spec) GetQueries() []*Query { @@ -511,7 +597,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_jaeger_proto_msgTypes[8] + mi := &file_jaeger_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -524,7 +610,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_jaeger_proto_msgTypes[8] + mi := &file_jaeger_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -537,7 +623,7 @@ func (x *Query) ProtoReflect() protoreflect.Message { // Deprecated: Use Query.ProtoReflect.Descriptor instead. func (*Query) Descriptor() ([]byte, []int) { - return file_jaeger_proto_rawDescGZIP(), []int{8} + return file_jaeger_proto_rawDescGZIP(), []int{10} } func (x *Query) GetName() string { @@ -572,80 +658,89 @@ var File_jaeger_proto protoreflect.FileDescriptor var file_jaeger_proto_rawDesc = []byte{ 0x0a, 0x0c, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x22, 0x44, - 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x22, 0x6e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x84, 0x02, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x69, 0x6e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x61, 0x67, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x22, 0x2b, 0x0a, 0x11, 0x47, - 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, - 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x44, 0x22, 0x2a, 0x0a, 0x10, 0x47, 0x65, 0x74, - 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, - 0x72, 0x61, 0x63, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x6e, 0x4b, 0x69, - 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x70, 0x61, 0x6e, 0x4b, 0x69, - 0x6e, 0x64, 0x22, 0x37, 0x0a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x12, 0x2f, 0x0a, 0x07, 0x71, 0x75, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x61, 0x67, 0x73, 0x32, 0x8d, 0x02, 0x0a, 0x06, 0x4a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x12, - 0x5e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x24, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, - 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, - 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x52, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, - 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x22, 0x28, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x44, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x22, 0x52, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x84, 0x02, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x69, 0x6e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x61, 0x67, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x22, 0x2b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, - 0x1f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, - 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x20, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, - 0x72, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x6b, 0x6f, 0x62, 0x73, 0x69, 0x6f, 0x2f, 0x6b, 0x6f, 0x62, 0x73, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6a, - 0x61, 0x65, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x44, 0x22, 0x2a, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x6e, 0x4b, + 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x70, 0x61, 0x6e, 0x4b, + 0x69, 0x6e, 0x64, 0x22, 0x37, 0x0a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x12, 0x2f, 0x0a, 0x07, 0x71, + 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x05, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x61, 0x67, 0x73, 0x32, 0xe7, 0x02, 0x0a, 0x06, 0x4a, 0x61, 0x65, 0x67, 0x65, 0x72, + 0x12, 0x58, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, + 0x22, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, + 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, + 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, + 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x09, 0x47, 0x65, + 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, + 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x54, + 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, + 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x6f, + 0x62, 0x73, 0x69, 0x6f, 0x2f, 0x6b, 0x6f, 0x62, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6a, 0x61, 0x65, 0x67, 0x65, 0x72, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -660,32 +755,36 @@ func file_jaeger_proto_rawDescGZIP() []byte { return file_jaeger_proto_rawDescData } -var file_jaeger_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_jaeger_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_jaeger_proto_goTypes = []interface{}{ - (*GetOperationsRequest)(nil), // 0: plugins.jaeger.GetOperationsRequest - (*GetOperationsResponse)(nil), // 1: plugins.jaeger.GetOperationsResponse - (*GetTracesRequest)(nil), // 2: plugins.jaeger.GetTracesRequest - (*GetTracesResponse)(nil), // 3: plugins.jaeger.GetTracesResponse - (*GetTraceRequest)(nil), // 4: plugins.jaeger.GetTraceRequest - (*GetTraceResponse)(nil), // 5: plugins.jaeger.GetTraceResponse - (*Operation)(nil), // 6: plugins.jaeger.Operation - (*Spec)(nil), // 7: plugins.jaeger.Spec - (*Query)(nil), // 8: plugins.jaeger.Query + (*GetServicesRequest)(nil), // 0: plugins.jaeger.GetServicesRequest + (*GetServicesResponse)(nil), // 1: plugins.jaeger.GetServicesResponse + (*GetOperationsRequest)(nil), // 2: plugins.jaeger.GetOperationsRequest + (*GetOperationsResponse)(nil), // 3: plugins.jaeger.GetOperationsResponse + (*GetTracesRequest)(nil), // 4: plugins.jaeger.GetTracesRequest + (*GetTracesResponse)(nil), // 5: plugins.jaeger.GetTracesResponse + (*GetTraceRequest)(nil), // 6: plugins.jaeger.GetTraceRequest + (*GetTraceResponse)(nil), // 7: plugins.jaeger.GetTraceResponse + (*Operation)(nil), // 8: plugins.jaeger.Operation + (*Spec)(nil), // 9: plugins.jaeger.Spec + (*Query)(nil), // 10: plugins.jaeger.Query } var file_jaeger_proto_depIdxs = []int32{ - 6, // 0: plugins.jaeger.GetOperationsResponse.operations:type_name -> plugins.jaeger.Operation - 8, // 1: plugins.jaeger.Spec.queries:type_name -> plugins.jaeger.Query - 0, // 2: plugins.jaeger.Jaeger.GetOperations:input_type -> plugins.jaeger.GetOperationsRequest - 2, // 3: plugins.jaeger.Jaeger.GetTraces:input_type -> plugins.jaeger.GetTracesRequest - 4, // 4: plugins.jaeger.Jaeger.GetTrace:input_type -> plugins.jaeger.GetTraceRequest - 1, // 5: plugins.jaeger.Jaeger.GetOperations:output_type -> plugins.jaeger.GetOperationsResponse - 3, // 6: plugins.jaeger.Jaeger.GetTraces:output_type -> plugins.jaeger.GetTracesResponse - 5, // 7: plugins.jaeger.Jaeger.GetTrace:output_type -> plugins.jaeger.GetTraceResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 8, // 0: plugins.jaeger.GetOperationsResponse.operations:type_name -> plugins.jaeger.Operation + 10, // 1: plugins.jaeger.Spec.queries:type_name -> plugins.jaeger.Query + 0, // 2: plugins.jaeger.Jaeger.GetServices:input_type -> plugins.jaeger.GetServicesRequest + 2, // 3: plugins.jaeger.Jaeger.GetOperations:input_type -> plugins.jaeger.GetOperationsRequest + 4, // 4: plugins.jaeger.Jaeger.GetTraces:input_type -> plugins.jaeger.GetTracesRequest + 6, // 5: plugins.jaeger.Jaeger.GetTrace:input_type -> plugins.jaeger.GetTraceRequest + 1, // 6: plugins.jaeger.Jaeger.GetServices:output_type -> plugins.jaeger.GetServicesResponse + 3, // 7: plugins.jaeger.Jaeger.GetOperations:output_type -> plugins.jaeger.GetOperationsResponse + 5, // 8: plugins.jaeger.Jaeger.GetTraces:output_type -> plugins.jaeger.GetTracesResponse + 7, // 9: plugins.jaeger.Jaeger.GetTrace:output_type -> plugins.jaeger.GetTraceResponse + 6, // [6:10] is the sub-list for method output_type + 2, // [2:6] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_jaeger_proto_init() } @@ -695,7 +794,7 @@ func file_jaeger_proto_init() { } if !protoimpl.UnsafeEnabled { file_jaeger_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOperationsRequest); i { + switch v := v.(*GetServicesRequest); i { case 0: return &v.state case 1: @@ -707,7 +806,7 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOperationsResponse); i { + switch v := v.(*GetServicesResponse); i { case 0: return &v.state case 1: @@ -719,7 +818,7 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTracesRequest); i { + switch v := v.(*GetOperationsRequest); i { case 0: return &v.state case 1: @@ -731,7 +830,7 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTracesResponse); i { + switch v := v.(*GetOperationsResponse); i { case 0: return &v.state case 1: @@ -743,7 +842,7 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTraceRequest); i { + switch v := v.(*GetTracesRequest); i { case 0: return &v.state case 1: @@ -755,7 +854,7 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTraceResponse); i { + switch v := v.(*GetTracesResponse); i { case 0: return &v.state case 1: @@ -767,7 +866,7 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operation); i { + switch v := v.(*GetTraceRequest); i { case 0: return &v.state case 1: @@ -779,7 +878,7 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Spec); i { + switch v := v.(*GetTraceResponse); i { case 0: return &v.state case 1: @@ -791,6 +890,30 @@ func file_jaeger_proto_init() { } } file_jaeger_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Operation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_jaeger_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Spec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_jaeger_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Query); i { case 0: return &v.state @@ -809,7 +932,7 @@ func file_jaeger_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_jaeger_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/api/plugins/jaeger/proto/jaeger_deepcopy.gen.go b/pkg/api/plugins/jaeger/proto/jaeger_deepcopy.gen.go index 44b906965..421dae8da 100644 --- a/pkg/api/plugins/jaeger/proto/jaeger_deepcopy.gen.go +++ b/pkg/api/plugins/jaeger/proto/jaeger_deepcopy.gen.go @@ -14,6 +14,48 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// DeepCopyInto supports using GetServicesRequest within kubernetes types, where deepcopy-gen is used. +func (in *GetServicesRequest) DeepCopyInto(out *GetServicesRequest) { + p := proto.Clone(in).(*GetServicesRequest) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GetServicesRequest. Required by controller-gen. +func (in *GetServicesRequest) DeepCopy() *GetServicesRequest { + if in == nil { + return nil + } + out := new(GetServicesRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new GetServicesRequest. Required by controller-gen. +func (in *GetServicesRequest) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using GetServicesResponse within kubernetes types, where deepcopy-gen is used. +func (in *GetServicesResponse) DeepCopyInto(out *GetServicesResponse) { + p := proto.Clone(in).(*GetServicesResponse) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GetServicesResponse. Required by controller-gen. +func (in *GetServicesResponse) DeepCopy() *GetServicesResponse { + if in == nil { + return nil + } + out := new(GetServicesResponse) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new GetServicesResponse. Required by controller-gen. +func (in *GetServicesResponse) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + // DeepCopyInto supports using GetOperationsRequest within kubernetes types, where deepcopy-gen is used. func (in *GetOperationsRequest) DeepCopyInto(out *GetOperationsRequest) { p := proto.Clone(in).(*GetOperationsRequest) diff --git a/pkg/api/plugins/jaeger/proto/jaeger_grpc.pb.go b/pkg/api/plugins/jaeger/proto/jaeger_grpc.pb.go index 55e9b1b18..be64dfb7c 100644 --- a/pkg/api/plugins/jaeger/proto/jaeger_grpc.pb.go +++ b/pkg/api/plugins/jaeger/proto/jaeger_grpc.pb.go @@ -18,6 +18,7 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type JaegerClient interface { + GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesResponse, error) GetOperations(ctx context.Context, in *GetOperationsRequest, opts ...grpc.CallOption) (*GetOperationsResponse, error) GetTraces(ctx context.Context, in *GetTracesRequest, opts ...grpc.CallOption) (*GetTracesResponse, error) GetTrace(ctx context.Context, in *GetTraceRequest, opts ...grpc.CallOption) (*GetTraceResponse, error) @@ -31,6 +32,15 @@ func NewJaegerClient(cc grpc.ClientConnInterface) JaegerClient { return &jaegerClient{cc} } +func (c *jaegerClient) GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesResponse, error) { + out := new(GetServicesResponse) + err := c.cc.Invoke(ctx, "/plugins.jaeger.Jaeger/GetServices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *jaegerClient) GetOperations(ctx context.Context, in *GetOperationsRequest, opts ...grpc.CallOption) (*GetOperationsResponse, error) { out := new(GetOperationsResponse) err := c.cc.Invoke(ctx, "/plugins.jaeger.Jaeger/GetOperations", in, out, opts...) @@ -62,6 +72,7 @@ func (c *jaegerClient) GetTrace(ctx context.Context, in *GetTraceRequest, opts . // All implementations must embed UnimplementedJaegerServer // for forward compatibility type JaegerServer interface { + GetServices(context.Context, *GetServicesRequest) (*GetServicesResponse, error) GetOperations(context.Context, *GetOperationsRequest) (*GetOperationsResponse, error) GetTraces(context.Context, *GetTracesRequest) (*GetTracesResponse, error) GetTrace(context.Context, *GetTraceRequest) (*GetTraceResponse, error) @@ -72,6 +83,9 @@ type JaegerServer interface { type UnimplementedJaegerServer struct { } +func (UnimplementedJaegerServer) GetServices(context.Context, *GetServicesRequest) (*GetServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServices not implemented") +} func (UnimplementedJaegerServer) GetOperations(context.Context, *GetOperationsRequest) (*GetOperationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") } @@ -94,6 +108,24 @@ func RegisterJaegerServer(s grpc.ServiceRegistrar, srv JaegerServer) { s.RegisterService(&Jaeger_ServiceDesc, srv) } +func _Jaeger_GetServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JaegerServer).GetServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/plugins.jaeger.Jaeger/GetServices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JaegerServer).GetServices(ctx, req.(*GetServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Jaeger_GetOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetOperationsRequest) if err := dec(in); err != nil { @@ -155,6 +187,10 @@ var Jaeger_ServiceDesc = grpc.ServiceDesc{ ServiceName: "plugins.jaeger.Jaeger", HandlerType: (*JaegerServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "GetServices", + Handler: _Jaeger_GetServices_Handler, + }, { MethodName: "GetOperations", Handler: _Jaeger_GetOperations_Handler, diff --git a/proto/jaeger.proto b/proto/jaeger.proto index 913bd8a3c..967df4e92 100644 --- a/proto/jaeger.proto +++ b/proto/jaeger.proto @@ -5,18 +5,26 @@ option go_package = "github.com/kobsio/kobs/pkg/api/plugins/jaeger/proto"; // Jaeger is the service to get traces from a configured Jaeger instance. service Jaeger { + rpc GetServices(GetServicesRequest) returns (GetServicesResponse) {} rpc GetOperations(GetOperationsRequest) returns (GetOperationsResponse) {} rpc GetTraces(GetTracesRequest) returns (GetTracesResponse) {} rpc GetTrace(GetTraceRequest) returns (GetTraceResponse) {} } +message GetServicesRequest { + string name = 1; +} + +message GetServicesResponse { + repeated string services = 1; +} + message GetOperationsRequest { string name = 1; string service = 2; } message GetOperationsResponse { - repeated string services = 1; repeated Operation operations = 2; }