Skip to content

Commit

Permalink
add metricstore send support
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanLjp committed Mar 27, 2024
1 parent 95b255f commit 303336f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
6 changes: 1 addition & 5 deletions log_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (s *LogStore) PutLogs(lg *LogGroup) (err error) {
}
var uri string
if s.MetricStore {
uri = s.getMetricStoreURL()
uri = fmt.Sprintf("/prometheus/%s/%s/api/v1/write", s.project.Name, s.Name)
} else {
uri = fmt.Sprintf("/logstores/%v", s.Name)
}
Expand All @@ -326,10 +326,6 @@ func (s *LogStore) PutLogs(lg *LogGroup) (err error) {
return nil
}

func (s *LogStore) getMetricStoreURL() string {
return fmt.Sprintf("/prometheus/%s/%s/api/v1/write", s.project.Name, s.Name)
}

// PostLogStoreLogs put logs into Shard logstore by hashKey.
// The callers should transform user logs into LogGroup.
func (s *LogStore) PostLogStoreLogs(lg *LogGroup, hashKey *string) (err error) {
Expand Down
17 changes: 0 additions & 17 deletions producer/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,6 @@ func (producer *Producer) SendLogList(project, logstore, topic, source string, l

}

func (producer *Producer) SendMetricStoreLogWithCallBack(project, logstore, topic, source string, log *sls.Log, callback CallBack) error {
err := producer.waitTime()
if err != nil {
return err
}
return producer.logAccumulator.addLogToProducerBatch(project, logstore, "", topic, source, log, callback)
}

func (producer *Producer) SendMetricStoreLogListWithCallBack(project, logstore, topic, source string, logList []*sls.Log, callback CallBack) (err error) {
err = producer.waitTime()
if err != nil {
return err
}
return producer.logAccumulator.addLogToProducerBatch(project, logstore, "", topic, source, logList, callback)

}

func (producer *Producer) HashSendLog(project, logstore, shardHash, topic, source string, log *sls.Log) error {
err := producer.waitTime()
if err != nil {
Expand Down

0 comments on commit 303336f

Please sign in to comment.