Documentation
¶
Overview ¶
Package agentv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAgentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAgentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentServiceClient) error
- func RegisterAgentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAgentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentServiceServer) error
- func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer)
- type AgentServiceClient
- type AgentServiceServer
- type GetTargetsRequest
- func (*GetTargetsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetTargetsRequest) GetState() State
- func (m *GetTargetsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GetTargetsRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *GetTargetsRequest) MarshalVT() (dAtA []byte, err error)
- func (*GetTargetsRequest) ProtoMessage()
- func (x *GetTargetsRequest) ProtoReflect() protoreflect.Message
- func (x *GetTargetsRequest) Reset()
- func (m *GetTargetsRequest) SizeVT() (n int)
- func (x *GetTargetsRequest) String() string
- func (m *GetTargetsRequest) UnmarshalVT(dAtA []byte) error
- type GetTargetsResponse
- func (*GetTargetsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetTargetsResponse) GetActiveTargets() []*Target
- func (x *GetTargetsResponse) GetDroppedTargets() []*Target
- func (m *GetTargetsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GetTargetsResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *GetTargetsResponse) MarshalVT() (dAtA []byte, err error)
- func (*GetTargetsResponse) ProtoMessage()
- func (x *GetTargetsResponse) ProtoReflect() protoreflect.Message
- func (x *GetTargetsResponse) Reset()
- func (m *GetTargetsResponse) SizeVT() (n int)
- func (x *GetTargetsResponse) String() string
- func (m *GetTargetsResponse) UnmarshalVT(dAtA []byte) error
- type Health
- type State
- type Target
- func (*Target) Descriptor() ([]byte, []int)deprecated
- func (x *Target) GetDiscoveredLabels() map[string]string
- func (x *Target) GetHealth() Health
- func (x *Target) GetLabels() map[string]string
- func (x *Target) GetLastError() string
- func (x *Target) GetLastScrape() *timestamppb.Timestamp
- func (x *Target) GetLastScrapeDuration() *durationpb.Duration
- func (x *Target) GetScrapeInterval() *durationpb.Duration
- func (x *Target) GetScrapePool() string
- func (x *Target) GetScrapeTimeout() *durationpb.Duration
- func (x *Target) GetScrapeUrl() string
- func (m *Target) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Target) MarshalToVT(dAtA []byte) (int, error)
- func (m *Target) MarshalVT() (dAtA []byte, err error)
- func (*Target) ProtoMessage()
- func (x *Target) ProtoReflect() protoreflect.Message
- func (x *Target) Reset()
- func (m *Target) SizeVT() (n int)
- func (x *Target) String() string
- func (m *Target) UnmarshalVT(dAtA []byte) error
- type UnimplementedAgentServiceServer
- type UnsafeAgentServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Health_name = map[int32]string{ 0: "HEALTH_UNSPECIFIED", 1: "HEALTH_UP", 2: "HEALTH_DOWN", } Health_value = map[string]int32{ "HEALTH_UNSPECIFIED": 0, "HEALTH_UP": 1, "HEALTH_DOWN": 2, } )
Enum value maps for Health.
var ( State_name = map[int32]string{ 0: "STATE_UNSPECIFIED", 1: "STATE_ACTIVE", 2: "STATE_DROPPED", } State_value = map[string]int32{ "STATE_UNSPECIFIED": 0, "STATE_ACTIVE": 1, "STATE_DROPPED": 2, } )
Enum value maps for State.
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var AgentService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agent.v1.AgentService", HandlerType: (*AgentServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetTargets", Handler: _AgentService_GetTargets_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "agent/v1/agent.proto", }
AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_agent_v1_agent_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAgentServiceHandler ¶
func RegisterAgentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAgentServiceHandler registers the http handlers for service AgentService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAgentServiceHandlerClient ¶
func RegisterAgentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentServiceClient) error
RegisterAgentServiceHandlerClient registers the http handlers for service AgentService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AgentServiceClient" to call the correct interceptors.
func RegisterAgentServiceHandlerFromEndpoint ¶
func RegisterAgentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAgentServiceHandlerFromEndpoint is same as RegisterAgentServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAgentServiceHandlerServer ¶
func RegisterAgentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentServiceServer) error
RegisterAgentServiceHandlerServer registers the http handlers for service AgentService to "mux". UnaryRPC :call AgentServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentServiceHandlerFromEndpoint instead.
func RegisterAgentServiceServer ¶
func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer)
Types ¶
type AgentServiceClient ¶
type AgentServiceClient interface { // Retrieve information about targets. GetTargets(ctx context.Context, in *GetTargetsRequest, opts ...grpc.CallOption) (*GetTargetsResponse, error) }
AgentServiceClient is the client API for AgentService service.
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.
func NewAgentServiceClient ¶
func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient
type AgentServiceServer ¶
type AgentServiceServer interface { // Retrieve information about targets. GetTargets(context.Context, *GetTargetsRequest) (*GetTargetsResponse, error) // contains filtered or unexported methods }
AgentServiceServer is the server API for AgentService service. All implementations must embed UnimplementedAgentServiceServer for forward compatibility
type GetTargetsRequest ¶
type GetTargetsRequest struct { State State `protobuf:"varint,1,opt,name=state,proto3,enum=agent.v1.State" json:"state,omitempty"` // contains filtered or unexported fields }
func (*GetTargetsRequest) Descriptor
deprecated
func (*GetTargetsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTargetsRequest.ProtoReflect.Descriptor instead.
func (*GetTargetsRequest) GetState ¶
func (x *GetTargetsRequest) GetState() State
func (*GetTargetsRequest) MarshalToSizedBufferVT ¶
func (m *GetTargetsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GetTargetsRequest) MarshalToVT ¶
func (m *GetTargetsRequest) MarshalToVT(dAtA []byte) (int, error)
func (*GetTargetsRequest) MarshalVT ¶
func (m *GetTargetsRequest) MarshalVT() (dAtA []byte, err error)
func (*GetTargetsRequest) ProtoMessage ¶
func (*GetTargetsRequest) ProtoMessage()
func (*GetTargetsRequest) ProtoReflect ¶
func (x *GetTargetsRequest) ProtoReflect() protoreflect.Message
func (*GetTargetsRequest) Reset ¶
func (x *GetTargetsRequest) Reset()
func (*GetTargetsRequest) SizeVT ¶
func (m *GetTargetsRequest) SizeVT() (n int)
func (*GetTargetsRequest) String ¶
func (x *GetTargetsRequest) String() string
func (*GetTargetsRequest) UnmarshalVT ¶
func (m *GetTargetsRequest) UnmarshalVT(dAtA []byte) error
type GetTargetsResponse ¶
type GetTargetsResponse struct { ActiveTargets []*Target `protobuf:"bytes,1,rep,name=active_targets,json=activeTargets,proto3" json:"active_targets,omitempty"` DroppedTargets []*Target `protobuf:"bytes,2,rep,name=dropped_targets,json=droppedTargets,proto3" json:"dropped_targets,omitempty"` // contains filtered or unexported fields }
func (*GetTargetsResponse) Descriptor
deprecated
func (*GetTargetsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetTargetsResponse.ProtoReflect.Descriptor instead.
func (*GetTargetsResponse) GetActiveTargets ¶
func (x *GetTargetsResponse) GetActiveTargets() []*Target
func (*GetTargetsResponse) GetDroppedTargets ¶
func (x *GetTargetsResponse) GetDroppedTargets() []*Target
func (*GetTargetsResponse) MarshalToSizedBufferVT ¶
func (m *GetTargetsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GetTargetsResponse) MarshalToVT ¶
func (m *GetTargetsResponse) MarshalToVT(dAtA []byte) (int, error)
func (*GetTargetsResponse) MarshalVT ¶
func (m *GetTargetsResponse) MarshalVT() (dAtA []byte, err error)
func (*GetTargetsResponse) ProtoMessage ¶
func (*GetTargetsResponse) ProtoMessage()
func (*GetTargetsResponse) ProtoReflect ¶
func (x *GetTargetsResponse) ProtoReflect() protoreflect.Message
func (*GetTargetsResponse) Reset ¶
func (x *GetTargetsResponse) Reset()
func (*GetTargetsResponse) SizeVT ¶
func (m *GetTargetsResponse) SizeVT() (n int)
func (*GetTargetsResponse) String ¶
func (x *GetTargetsResponse) String() string
func (*GetTargetsResponse) UnmarshalVT ¶
func (m *GetTargetsResponse) UnmarshalVT(dAtA []byte) error
type Health ¶
type Health int32
func (Health) Descriptor ¶
func (Health) Descriptor() protoreflect.EnumDescriptor
func (Health) EnumDescriptor
deprecated
func (Health) Number ¶
func (x Health) Number() protoreflect.EnumNumber
func (Health) Type ¶
func (Health) Type() protoreflect.EnumType
type State ¶
type State int32
func (State) Descriptor ¶
func (State) Descriptor() protoreflect.EnumDescriptor
func (State) EnumDescriptor
deprecated
func (State) Number ¶
func (x State) Number() protoreflect.EnumNumber
func (State) Type ¶
func (State) Type() protoreflect.EnumType
type Target ¶
type Target struct { // Contains labels before any processing. DiscoveredLabels map[string]string `` /* 197-byte string literal not displayed */ // Labels as they are attached to ingested profiles. Labels map[string]string `` /* 153-byte string literal not displayed */ // Name of the scrape pool used ScrapePool string `protobuf:"bytes,3,opt,name=scrape_pool,json=scrapePool,proto3" json:"scrape_pool,omitempty"` // URL that is used for retrieving the profile. ScrapeUrl string `protobuf:"bytes,4,opt,name=scrape_url,json=scrapeUrl,proto3" json:"scrape_url,omitempty"` // Contains the error if the last attempted scrape has failed. LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"last_error,omitempty"` // Timestamp of last scrape LastScrape *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_scrape,json=lastScrape,proto3" json:"last_scrape,omitempty"` // Duation of last scrape. LastScrapeDuration *durationpb.Duration `protobuf:"bytes,7,opt,name=last_scrape_duration,json=lastScrapeDuration,proto3" json:"last_scrape_duration,omitempty"` // Health of last scrape. Health Health `protobuf:"varint,8,opt,name=health,proto3,enum=agent.v1.Health" json:"health,omitempty"` // Timeout duration for the scrape request. ScrapeTimeout *durationpb.Duration `protobuf:"bytes,9,opt,name=scrape_timeout,json=scrapeTimeout,proto3" json:"scrape_timeout,omitempty"` // Interval how often profiles are scraped. ScrapeInterval *durationpb.Duration `protobuf:"bytes,10,opt,name=scrape_interval,json=scrapeInterval,proto3" json:"scrape_interval,omitempty"` // contains filtered or unexported fields }
func (*Target) Descriptor
deprecated
func (*Target) GetDiscoveredLabels ¶
func (*Target) GetLastError ¶
func (*Target) GetLastScrape ¶
func (x *Target) GetLastScrape() *timestamppb.Timestamp
func (*Target) GetLastScrapeDuration ¶
func (x *Target) GetLastScrapeDuration() *durationpb.Duration
func (*Target) GetScrapeInterval ¶
func (x *Target) GetScrapeInterval() *durationpb.Duration
func (*Target) GetScrapePool ¶
func (*Target) GetScrapeTimeout ¶
func (x *Target) GetScrapeTimeout() *durationpb.Duration
func (*Target) GetScrapeUrl ¶
func (*Target) MarshalToSizedBufferVT ¶
func (*Target) ProtoMessage ¶
func (*Target) ProtoMessage()
func (*Target) ProtoReflect ¶
func (x *Target) ProtoReflect() protoreflect.Message
func (*Target) UnmarshalVT ¶
type UnimplementedAgentServiceServer ¶
type UnimplementedAgentServiceServer struct { }
UnimplementedAgentServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAgentServiceServer) GetTargets ¶
func (UnimplementedAgentServiceServer) GetTargets(context.Context, *GetTargetsRequest) (*GetTargetsResponse, error)
type UnsafeAgentServiceServer ¶
type UnsafeAgentServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AgentServiceServer will result in compilation errors.