Documentation ¶
Index ¶
Constants ¶
View Source
const ( Replace string = "replace" Keep string = "keep" Drop string = "drop" HashMod string = "hashmod" LabelMap string = "labelmap" LabelDrop string = "labeldrop" LabelKeep string = "labelkeep" Lowercase string = "lowercase" Uppercase string = "uppercase" )
标签操作的常量
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SafeList ¶
func NewSafeList ¶
func NewSafeList() *SafeList
func (*SafeList) PopBack ¶
func (sl *SafeList) PopBack(max int) []*prompb.TimeSeries
从列表的尾部弹出指定数量的元素,并返回 *prompb.TimeSeries 的切片
func (*SafeList) PushFrontBatch ¶
func (sl *SafeList) PushFrontBatch(vs []interface{})
将多个元素批量插入到列表的头部
type SafeListLimited ¶
type SafeListLimited struct { SL *SafeList // 继承 SafeList // contains filtered or unexported fields }
SafeList with Limited Size
func NewSafeListLimited ¶
func NewSafeListLimited(maxSize int) *SafeListLimited
func (*SafeListLimited) Len ¶
func (sll *SafeListLimited) Len() int
func (*SafeListLimited) PopBack ¶
func (sll *SafeListLimited) PopBack(max int) []*prompb.TimeSeries
func (*SafeListLimited) PushFront ¶
func (sll *SafeListLimited) PushFront(v interface{}) bool
func (*SafeListLimited) PushFrontBatch ¶
func (sll *SafeListLimited) PushFrontBatch(vs []interface{}) bool
func (*SafeListLimited) RemoveAll ¶
func (sll *SafeListLimited) RemoveAll()
type WriterType ¶
type WriterType struct { Opts pconf.WriterOptions // 配置信息,包括 URL、认证信息等。 ForceUseServerTS bool // 是否强制使用服务器时间戳 Client api.Client // Prometheus 客户端,用于发送数据到远程目标 }
写入目标的配置信息和客户端
func (WriterType) Post ¶
func (w WriterType) Post(req []byte, headers ...map[string]string) error
发送 HTTP POST 请求到远程目标
func (WriterType) Write ¶
func (w WriterType) Write(items []*prompb.TimeSeries, sema *semaphore.Semaphore, headers ...map[string]string)
将时间序列数据写入远程目标,根据配置进行数据的重写和请求的发送
type WritersType ¶
多个时间序列数据写入目标的集合
func NewWriters ¶
func NewWriters(pushgwConfig pconf.Pushgw) *WritersType
func (*WritersType) Init ¶
func (ws *WritersType) Init() error
初始化时间序列数据写入目标,包括创建 Prometheus 客户端、设置 HTTP Transport 选项等
func (*WritersType) PushSample ¶
func (ws *WritersType) PushSample(ident string, v interface{})
将时间序列数据推送到指定的目标队列
func (*WritersType) Put ¶
func (ws *WritersType) Put(name string, writer WriterType)
func (*WritersType) StartConsumer ¶
func (ws *WritersType) StartConsumer(identQueue *IdentQueue)
消费队列
Click to show internal directories.
Click to hide internal directories.