develop: 开发 host-metrics-collector 采集模块
This commit is contained in:
parent
1eb206a57e
commit
3c071afa50
66
api/collector.proto
Normal file
66
api/collector.proto
Normal file
@ -0,0 +1,66 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package hms.collector.v1;
|
||||
|
||||
option go_package = "git.opencomputing.cn/yumoqing/host-metrics-collector/pkg/collectorpb;collectorpb";
|
||||
|
||||
// MetricSample 表示单条指标样本,labels 统一携带 host_id / service / metric_group。
|
||||
message MetricSample {
|
||||
string name = 1;
|
||||
double value = 2;
|
||||
int64 timestamp = 3; // Unix 秒
|
||||
map<string, string> labels = 4;
|
||||
}
|
||||
|
||||
// MetricBatch 是 Agent 一次批量上报的指标消息。
|
||||
message MetricBatch {
|
||||
string host_id = 1;
|
||||
string agent_version = 2;
|
||||
int64 seq = 3;
|
||||
int64 sent_at = 4; // Unix 秒
|
||||
repeated MetricSample samples = 5;
|
||||
}
|
||||
|
||||
// LogEntry 表示单条主机日志,offset 用于日志文件断点续传。
|
||||
message LogEntry {
|
||||
int64 timestamp = 1; // Unix 秒
|
||||
string level = 2;
|
||||
string source = 3;
|
||||
string message = 4;
|
||||
map<string, string> fields = 5;
|
||||
string file = 6;
|
||||
int64 offset = 7;
|
||||
}
|
||||
|
||||
// LogBatch 是 Agent 一次批量上报的日志消息。
|
||||
message LogBatch {
|
||||
string host_id = 1;
|
||||
int64 seq = 2;
|
||||
repeated LogEntry entries = 3;
|
||||
}
|
||||
|
||||
// Ack 是上报接口的统一确认响应。
|
||||
message Ack {
|
||||
bool ok = 1;
|
||||
int64 seq = 2;
|
||||
string error = 3;
|
||||
}
|
||||
|
||||
// HeartbeatRequest 是 Agent 心跳/注册/配置下发请求。
|
||||
message HeartbeatRequest {
|
||||
string host_id = 1;
|
||||
string agent_version = 2;
|
||||
int64 config_version = 3;
|
||||
}
|
||||
|
||||
// HeartbeatResponse 是心跳响应。
|
||||
message HeartbeatResponse {
|
||||
bool ok = 1;
|
||||
int64 server_time = 2; // Unix 秒
|
||||
map<string, string> config = 3;
|
||||
}
|
||||
|
||||
// CheckpointResponse 返回服务端已确认的序号。
|
||||
message CheckpointResponse {
|
||||
int64 last_acked_seq = 1;
|
||||
}
|
||||
9
go.mod
Normal file
9
go.mod
Normal file
@ -0,0 +1,9 @@
|
||||
module git.opencomputing.cn/yumoqing/host-metrics-collector
|
||||
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
github.com/redis/go-redis/v9 v9.5.1
|
||||
github.com/shirou/gopsutil/v4 v4.24.6
|
||||
google.golang.org/protobuf v1.34.2
|
||||
)
|
||||
40
internal/checkpoint/store.go
Normal file
40
internal/checkpoint/store.go
Normal file
@ -0,0 +1,40 @@
|
||||
// Package checkpoint 实现 Agent 断点续传所需的检查点存储。
|
||||
//
|
||||
// 日志文件检查点记录「文件路径 → 已消费 offset」,指标上报检查点记录
|
||||
// 「host_id → 已确认 seq」。默认提供 memory / file / redis 三种驱动,
|
||||
// 生产环境使用 Redis 记录 offset,实现进程重启后从已确认点继续。
|
||||
package checkpoint
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Store 是检查点存储的抽象接口。
|
||||
type Store interface {
|
||||
// GetLogOffset 返回指定日志文件已消费到的 offset,不存在时返回 0。
|
||||
GetLogOffset(file string) (int64, error)
|
||||
// SetLogOffset 推进日志文件 offset。
|
||||
SetLogOffset(file string, offset int64) error
|
||||
|
||||
// GetAckedSeq 返回指定主机已确认的上报序号,不存在时返回 0。
|
||||
GetAckedSeq(hostID string) (int64, error)
|
||||
// SetAckedSeq 推进主机已确认的上报序号。
|
||||
SetAckedSeq(hostID string, seq int64) error
|
||||
|
||||
Close() error
|
||||
}
|
||||
|
||||
// New 根据驱动名创建检查点存储。
|
||||
//
|
||||
// 支持:memory(进程内,测试/零依赖)、file(本地 JSON 持久化)、
|
||||
// redis(Redis 记录 offset,生产推荐)。
|
||||
func New(driver, file, redisURL string) (Store, error) {
|
||||
switch driver {
|
||||
case "", "memory":
|
||||
return NewMemoryStore(), nil
|
||||
case "file":
|
||||
return NewFileStore(file)
|
||||
case "redis":
|
||||
return NewRedisStore(redisURL)
|
||||
default:
|
||||
return nil, fmt.Errorf("checkpoint: unknown driver %q", driver)
|
||||
}
|
||||
}
|
||||
117
internal/config/config.go
Normal file
117
internal/config/config.go
Normal file
@ -0,0 +1,117 @@
|
||||
// Package config 提供 Agent 与 Gateway 的配置加载(环境变量优先,内置默认值)。
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// AgentConfig 是 Agent 端运行配置。
|
||||
type AgentConfig struct {
|
||||
HostID string
|
||||
AgentVersion string
|
||||
|
||||
GatewayURL string
|
||||
AgentToken string
|
||||
|
||||
LogFiles []string
|
||||
|
||||
CoreInterval time.Duration
|
||||
DiskInterval time.Duration
|
||||
NetworkInterval time.Duration
|
||||
ProcessInterval time.Duration
|
||||
|
||||
BatchSize int
|
||||
FlushInterval time.Duration
|
||||
|
||||
CheckpointDriver string // memory | file | redis
|
||||
CheckpointFile string
|
||||
RedisURL string
|
||||
|
||||
CollectTimeout time.Duration
|
||||
}
|
||||
|
||||
// DefaultAgentConfig 返回 Agent 默认配置。
|
||||
func DefaultAgentConfig() AgentConfig {
|
||||
return AgentConfig{
|
||||
HostID: env("HMS_HOST_ID", "host-001"),
|
||||
AgentVersion: env("HMS_AGENT_VERSION", "0.1.0"),
|
||||
GatewayURL: env("HMS_GATEWAY_URL", "http://127.0.0.1:4318"),
|
||||
AgentToken: env("HMS_AGENT_TOKEN", "dev-token"),
|
||||
LogFiles: splitCSV(env("HMS_LOG_FILES", "")),
|
||||
CoreInterval: durEnv("HMS_CORE_INTERVAL", 15*time.Second),
|
||||
DiskInterval: durEnv("HMS_DISK_INTERVAL", 30*time.Second),
|
||||
NetworkInterval: durEnv("HMS_NETWORK_INTERVAL", 30*time.Second),
|
||||
ProcessInterval: durEnv("HMS_PROCESS_INTERVAL", 60*time.Second),
|
||||
BatchSize: intEnv("HMS_BATCH_SIZE", 128),
|
||||
FlushInterval: durEnv("HMS_FLUSH_INTERVAL", 10*time.Second),
|
||||
CheckpointDriver: env("HMS_CHECKPOINT_DRIVER", "file"),
|
||||
CheckpointFile: env("HMS_CHECKPOINT_FILE", "checkpoint.json"),
|
||||
RedisURL: env("HMS_REDIS_URL", "redis://127.0.0.1:6379/0"),
|
||||
CollectTimeout: durEnv("HMS_COLLECT_TIMEOUT", 5*time.Second),
|
||||
}
|
||||
}
|
||||
|
||||
// GatewayConfig 是服务端 Collector Gateway 配置。
|
||||
type GatewayConfig struct {
|
||||
Addr string
|
||||
AgentToken string
|
||||
|
||||
// 查询内存存储的保留上限。
|
||||
MaxMetricsPerHost int
|
||||
MaxLogsPerHost int
|
||||
|
||||
RedisURL string
|
||||
}
|
||||
|
||||
// DefaultGatewayConfig 返回 Gateway 默认配置。
|
||||
func DefaultGatewayConfig() GatewayConfig {
|
||||
return GatewayConfig{
|
||||
Addr: env("HMS_GATEWAY_ADDR", "0.0.0.0:4318"),
|
||||
AgentToken: env("HMS_AGENT_TOKEN", "dev-token"),
|
||||
MaxMetricsPerHost: intEnv("HMS_MAX_METRICS_PER_HOST", 20000),
|
||||
MaxLogsPerHost: intEnv("HMS_MAX_LOGS_PER_HOST", 20000),
|
||||
RedisURL: env("HMS_REDIS_URL", "redis://127.0.0.1:6379/0"),
|
||||
}
|
||||
}
|
||||
|
||||
func env(key, def string) string {
|
||||
if v, ok := os.LookupEnv(key); ok && v != "" {
|
||||
return v
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func durEnv(key string, def time.Duration) time.Duration {
|
||||
if v, ok := os.LookupEnv(key); ok && v != "" {
|
||||
if d, err := time.ParseDuration(v); err == nil {
|
||||
return d
|
||||
}
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func intEnv(key string, def int) int {
|
||||
if v, ok := os.LookupEnv(key); ok && v != "" {
|
||||
if n, err := strconv.Atoi(v); err == nil {
|
||||
return n
|
||||
}
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func splitCSV(v string) []string {
|
||||
if v == "" {
|
||||
return nil
|
||||
}
|
||||
parts := strings.Split(v, ",")
|
||||
out := make([]string, 0, len(parts))
|
||||
for _, p := range parts {
|
||||
if p = strings.TrimSpace(p); p != "" {
|
||||
out = append(out, p)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
70
internal/model/model.go
Normal file
70
internal/model/model.go
Normal file
@ -0,0 +1,70 @@
|
||||
// Package model 定义采集模块的领域模型与指标命名规范。
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// 指标组名称,用于标签 metric_group 与采集调度分组。
|
||||
const (
|
||||
GroupCore = "core" // 15s
|
||||
GroupDisk = "disk" // 30s
|
||||
GroupNetwork = "network" // 30s
|
||||
GroupProcess = "process" // 60s
|
||||
)
|
||||
|
||||
// 指标命名规范:<domain>.<metric>。
|
||||
const (
|
||||
MetricCPUUsage = "cpu.usage"
|
||||
MetricMemUsedPercent = "mem.used_percent"
|
||||
MetricLoad1m = "load.1m"
|
||||
|
||||
MetricDiskUsedPercent = "disk.used_percent"
|
||||
MetricDiskIOReadBytes = "disk.io.read_bytes"
|
||||
MetricDiskIOWriteBytes = "disk.io.write_bytes"
|
||||
|
||||
MetricNetBytesSent = "net.bytes_sent"
|
||||
MetricNetBytesRecv = "net.bytes_recv"
|
||||
MetricNetPktDrop = "net.pkt_drop"
|
||||
|
||||
MetricProcessCPU = "process.cpu"
|
||||
MetricProcessMem = "process.mem"
|
||||
MetricProcessCount = "process.count"
|
||||
)
|
||||
|
||||
// 标签键。
|
||||
const (
|
||||
LabelHostID = "host_id"
|
||||
LabelService = "service"
|
||||
LabelMetricGroup = "metric_group"
|
||||
)
|
||||
|
||||
// Sample 是采集模块内部的指标样本表示,与 protobuf MetricSample 保持一一对应。
|
||||
type Sample struct {
|
||||
Name string
|
||||
Value float64
|
||||
Timestamp int64
|
||||
Labels map[string]string
|
||||
}
|
||||
|
||||
// NewSample 构造一个携带基础标签的样本。
|
||||
func NewSample(name string, value float64, at time.Time, labels map[string]string) Sample {
|
||||
if labels == nil {
|
||||
labels = map[string]string{}
|
||||
}
|
||||
return Sample{
|
||||
Name: name,
|
||||
Value: value,
|
||||
Timestamp: at.Unix(),
|
||||
Labels: labels,
|
||||
}
|
||||
}
|
||||
|
||||
// LogRecord 是采集模块内部的日志记录表示。
|
||||
type LogRecord struct {
|
||||
Timestamp int64
|
||||
Level string
|
||||
Source string
|
||||
Message string
|
||||
Fields map[string]string
|
||||
File string
|
||||
Offset int64
|
||||
}
|
||||
826
pkg/collectorpb/collector.pb.go
Normal file
826
pkg/collectorpb/collector.pb.go
Normal file
@ -0,0 +1,826 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.2
|
||||
// protoc v4.25.3
|
||||
// source: api/collector.proto
|
||||
|
||||
package collectorpb
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// MetricSample 表示单条指标样本,labels 统一携带 host_id / service / metric_group。
|
||||
type MetricSample struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Unix 秒
|
||||
Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *MetricSample) Reset() {
|
||||
*x = MetricSample{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MetricSample) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MetricSample) ProtoMessage() {}
|
||||
|
||||
func (x *MetricSample) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_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 MetricSample.ProtoReflect.Descriptor instead.
|
||||
func (*MetricSample) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MetricSample) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MetricSample) GetValue() float64 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MetricSample) GetTimestamp() int64 {
|
||||
if x != nil {
|
||||
return x.Timestamp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MetricSample) GetLabels() map[string]string {
|
||||
if x != nil {
|
||||
return x.Labels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MetricBatch 是 Agent 一次批量上报的指标消息。
|
||||
type MetricBatch struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"`
|
||||
AgentVersion string `protobuf:"bytes,2,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"`
|
||||
Seq int64 `protobuf:"varint,3,opt,name=seq,proto3" json:"seq,omitempty"`
|
||||
SentAt int64 `protobuf:"varint,4,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"` // Unix 秒
|
||||
Samples []*MetricSample `protobuf:"bytes,5,rep,name=samples,proto3" json:"samples,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MetricBatch) Reset() {
|
||||
*x = MetricBatch{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MetricBatch) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MetricBatch) ProtoMessage() {}
|
||||
|
||||
func (x *MetricBatch) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_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 MetricBatch.ProtoReflect.Descriptor instead.
|
||||
func (*MetricBatch) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *MetricBatch) GetHostId() string {
|
||||
if x != nil {
|
||||
return x.HostId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MetricBatch) GetAgentVersion() string {
|
||||
if x != nil {
|
||||
return x.AgentVersion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MetricBatch) GetSeq() int64 {
|
||||
if x != nil {
|
||||
return x.Seq
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MetricBatch) GetSentAt() int64 {
|
||||
if x != nil {
|
||||
return x.SentAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MetricBatch) GetSamples() []*MetricSample {
|
||||
if x != nil {
|
||||
return x.Samples
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// LogEntry 表示单条主机日志,offset 用于日志文件断点续传。
|
||||
type LogEntry struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Unix 秒
|
||||
Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"`
|
||||
Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
|
||||
Fields map[string]string `protobuf:"bytes,5,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
File string `protobuf:"bytes,6,opt,name=file,proto3" json:"file,omitempty"`
|
||||
Offset int64 `protobuf:"varint,7,opt,name=offset,proto3" json:"offset,omitempty"`
|
||||
}
|
||||
|
||||
func (x *LogEntry) Reset() {
|
||||
*x = LogEntry{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LogEntry) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LogEntry) ProtoMessage() {}
|
||||
|
||||
func (x *LogEntry) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_proto_msgTypes[2]
|
||||
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 LogEntry.ProtoReflect.Descriptor instead.
|
||||
func (*LogEntry) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *LogEntry) GetTimestamp() int64 {
|
||||
if x != nil {
|
||||
return x.Timestamp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LogEntry) GetLevel() string {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LogEntry) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LogEntry) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LogEntry) GetFields() map[string]string {
|
||||
if x != nil {
|
||||
return x.Fields
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *LogEntry) GetFile() string {
|
||||
if x != nil {
|
||||
return x.File
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LogEntry) GetOffset() int64 {
|
||||
if x != nil {
|
||||
return x.Offset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// LogBatch 是 Agent 一次批量上报的日志消息。
|
||||
type LogBatch struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"`
|
||||
Seq int64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"`
|
||||
Entries []*LogEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries,omitempty"`
|
||||
}
|
||||
|
||||
func (x *LogBatch) Reset() {
|
||||
*x = LogBatch{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LogBatch) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LogBatch) ProtoMessage() {}
|
||||
|
||||
func (x *LogBatch) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_proto_msgTypes[3]
|
||||
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 LogBatch.ProtoReflect.Descriptor instead.
|
||||
func (*LogBatch) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *LogBatch) GetHostId() string {
|
||||
if x != nil {
|
||||
return x.HostId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LogBatch) GetSeq() int64 {
|
||||
if x != nil {
|
||||
return x.Seq
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LogBatch) GetEntries() []*LogEntry {
|
||||
if x != nil {
|
||||
return x.Entries
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Ack 是上报接口的统一确认响应。
|
||||
type Ack struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
|
||||
Seq int64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"`
|
||||
Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Ack) Reset() {
|
||||
*x = Ack{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Ack) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Ack) ProtoMessage() {}
|
||||
|
||||
func (x *Ack) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_proto_msgTypes[4]
|
||||
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 Ack.ProtoReflect.Descriptor instead.
|
||||
func (*Ack) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *Ack) GetOk() bool {
|
||||
if x != nil {
|
||||
return x.Ok
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Ack) GetSeq() int64 {
|
||||
if x != nil {
|
||||
return x.Seq
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Ack) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// HeartbeatRequest 是 Agent 心跳/注册/配置下发请求。
|
||||
type HeartbeatRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"`
|
||||
AgentVersion string `protobuf:"bytes,2,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"`
|
||||
ConfigVersion int64 `protobuf:"varint,3,opt,name=config_version,json=configVersion,proto3" json:"config_version,omitempty"`
|
||||
}
|
||||
|
||||
func (x *HeartbeatRequest) Reset() {
|
||||
*x = HeartbeatRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HeartbeatRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HeartbeatRequest) ProtoMessage() {}
|
||||
|
||||
func (x *HeartbeatRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_proto_msgTypes[5]
|
||||
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 HeartbeatRequest.ProtoReflect.Descriptor instead.
|
||||
func (*HeartbeatRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *HeartbeatRequest) GetHostId() string {
|
||||
if x != nil {
|
||||
return x.HostId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HeartbeatRequest) GetAgentVersion() string {
|
||||
if x != nil {
|
||||
return x.AgentVersion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HeartbeatRequest) GetConfigVersion() int64 {
|
||||
if x != nil {
|
||||
return x.ConfigVersion
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// HeartbeatResponse 是心跳响应。
|
||||
type HeartbeatResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
|
||||
ServerTime int64 `protobuf:"varint,2,opt,name=server_time,json=serverTime,proto3" json:"server_time,omitempty"` // Unix 秒
|
||||
Config map[string]string `protobuf:"bytes,3,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *HeartbeatResponse) Reset() {
|
||||
*x = HeartbeatResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HeartbeatResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HeartbeatResponse) ProtoMessage() {}
|
||||
|
||||
func (x *HeartbeatResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_proto_msgTypes[6]
|
||||
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 HeartbeatResponse.ProtoReflect.Descriptor instead.
|
||||
func (*HeartbeatResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *HeartbeatResponse) GetOk() bool {
|
||||
if x != nil {
|
||||
return x.Ok
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *HeartbeatResponse) GetServerTime() int64 {
|
||||
if x != nil {
|
||||
return x.ServerTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HeartbeatResponse) GetConfig() map[string]string {
|
||||
if x != nil {
|
||||
return x.Config
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CheckpointResponse 返回服务端已确认的序号。
|
||||
type CheckpointResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
LastAckedSeq int64 `protobuf:"varint,1,opt,name=last_acked_seq,json=lastAckedSeq,proto3" json:"last_acked_seq,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CheckpointResponse) Reset() {
|
||||
*x = CheckpointResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_collector_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CheckpointResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CheckpointResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CheckpointResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_collector_proto_msgTypes[7]
|
||||
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 CheckpointResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CheckpointResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_collector_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *CheckpointResponse) GetLastAckedSeq() int64 {
|
||||
if x != nil {
|
||||
return x.LastAckedSeq
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_api_collector_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_collector_proto_rawDesc = []byte{
|
||||
0x0a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x68, 0x6d, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65,
|
||||
0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x22, 0xd5, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72,
|
||||
0x69, 0x63, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
|
||||
0x12, 0x42, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x2a, 0x2e, 0x68, 0x6d, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65,
|
||||
0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61,
|
||||
0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22,
|
||||
0xb0, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12,
|
||||
0x17, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x67, 0x65, 0x6e,
|
||||
0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x0c, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x73, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12,
|
||||
0x17, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x06, 0x73, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70,
|
||||
0x6c, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x68, 0x6d, 0x73, 0x2e,
|
||||
0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74,
|
||||
0x72, 0x69, 0x63, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c,
|
||||
0x65, 0x73, 0x22, 0x97, 0x02, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65,
|
||||
0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65,
|
||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18,
|
||||
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x68, 0x6d, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6c,
|
||||
0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66,
|
||||
0x73, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65,
|
||||
0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6b, 0x0a, 0x08,
|
||||
0x4c, 0x6f, 0x67, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49,
|
||||
0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03,
|
||||
0x73, 0x65, 0x71, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x68, 0x6d, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65,
|
||||
0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x03, 0x41, 0x63, 0x6b,
|
||||
0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73,
|
||||
0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x77, 0x0a, 0x10, 0x48, 0x65, 0x61, 0x72,
|
||||
0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07,
|
||||
0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68,
|
||||
0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x76,
|
||||
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x67,
|
||||
0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x22, 0xc8, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65,
|
||||
0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x65,
|
||||
0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x68, 0x6d, 0x73, 0x2e, 0x63,
|
||||
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x72,
|
||||
0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69,
|
||||
0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3a, 0x0a, 0x12,
|
||||
0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x6b, 0x65, 0x64,
|
||||
0x5f, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74,
|
||||
0x41, 0x63, 0x6b, 0x65, 0x64, 0x53, 0x65, 0x71, 0x42, 0x52, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x2e,
|
||||
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6e,
|
||||
0x2f, 0x79, 0x75, 0x6d, 0x6f, 0x71, 0x69, 0x6e, 0x67, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x2d, 0x6d,
|
||||
0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
|
||||
0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x70, 0x62,
|
||||
0x3b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_collector_proto_rawDescOnce sync.Once
|
||||
file_api_collector_proto_rawDescData = file_api_collector_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_collector_proto_rawDescGZIP() []byte {
|
||||
file_api_collector_proto_rawDescOnce.Do(func() {
|
||||
file_api_collector_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_collector_proto_rawDescData)
|
||||
})
|
||||
return file_api_collector_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_api_collector_proto_goTypes = []any{
|
||||
(*MetricSample)(nil), // 0: hms.collector.v1.MetricSample
|
||||
(*MetricBatch)(nil), // 1: hms.collector.v1.MetricBatch
|
||||
(*LogEntry)(nil), // 2: hms.collector.v1.LogEntry
|
||||
(*LogBatch)(nil), // 3: hms.collector.v1.LogBatch
|
||||
(*Ack)(nil), // 4: hms.collector.v1.Ack
|
||||
(*HeartbeatRequest)(nil), // 5: hms.collector.v1.HeartbeatRequest
|
||||
(*HeartbeatResponse)(nil), // 6: hms.collector.v1.HeartbeatResponse
|
||||
(*CheckpointResponse)(nil), // 7: hms.collector.v1.CheckpointResponse
|
||||
nil, // 8: hms.collector.v1.MetricSample.LabelsEntry
|
||||
nil, // 9: hms.collector.v1.LogEntry.FieldsEntry
|
||||
nil, // 10: hms.collector.v1.HeartbeatResponse.ConfigEntry
|
||||
}
|
||||
var file_api_collector_proto_depIdxs = []int32{
|
||||
8, // 0: hms.collector.v1.MetricSample.labels:type_name -> hms.collector.v1.MetricSample.LabelsEntry
|
||||
0, // 1: hms.collector.v1.MetricBatch.samples:type_name -> hms.collector.v1.MetricSample
|
||||
9, // 2: hms.collector.v1.LogEntry.fields:type_name -> hms.collector.v1.LogEntry.FieldsEntry
|
||||
2, // 3: hms.collector.v1.LogBatch.entries:type_name -> hms.collector.v1.LogEntry
|
||||
10, // 4: hms.collector.v1.HeartbeatResponse.config:type_name -> hms.collector.v1.HeartbeatResponse.ConfigEntry
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_collector_proto_init() }
|
||||
func file_api_collector_proto_init() {
|
||||
if File_api_collector_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_collector_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*MetricSample); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_collector_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*MetricBatch); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_collector_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*LogEntry); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_collector_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*LogBatch); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_collector_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*Ack); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_collector_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*HeartbeatRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_collector_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*HeartbeatResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_collector_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*CheckpointResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_collector_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_api_collector_proto_goTypes,
|
||||
DependencyIndexes: file_api_collector_proto_depIdxs,
|
||||
MessageInfos: file_api_collector_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_collector_proto = out.File
|
||||
file_api_collector_proto_rawDesc = nil
|
||||
file_api_collector_proto_goTypes = nil
|
||||
file_api_collector_proto_depIdxs = nil
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user