change prefix of source, servie, and tags

This commit is contained in:
kongfei 2022-06-02 16:49:58 +08:00
parent fc3eac28e6
commit 236157ef78
3 changed files with 5 additions and 4 deletions

View File

@ -133,6 +133,7 @@ func (d *Destination) unconditionalSend(payload []byte) (err error) {
// this can happen when the method or the url are valid.
return err
}
req.Header.Set("User-Agent", "categraf")
req.Header.Set("CATEGRAF-API-KEY", d.apiKey)
req.Header.Set("Content-Type", d.contentType)
req.Header.Set("Content-Encoding", d.contentEncoding.name())

View File

@ -15,7 +15,7 @@ import (
)
// serviceEnvVar is the environment variable of the service tag (this is used only for the serverless agent)
const serviceEnvVar = "DD_SERVICE"
const serviceEnvVar = "FC_SERVICE"
// Tailer consumes and processes a channel of strings, and sends them to a stream of log messages.
type Tailer struct {

View File

@ -39,11 +39,11 @@ func (o *Origin) TagsPayload() []byte {
source := o.Source()
if source != "" {
tagsPayload = append(tagsPayload, []byte("[dd ddsource=\""+source+"\"]")...)
tagsPayload = append(tagsPayload, []byte("[fc fcsource=\""+source+"\"]")...)
}
sourceCategory := o.LogSource.Config.SourceCategory
if sourceCategory != "" {
tagsPayload = append(tagsPayload, []byte("[dd ddsourcecategory=\""+sourceCategory+"\"]")...)
tagsPayload = append(tagsPayload, []byte("[fc fcsourcecategory=\""+sourceCategory+"\"]")...)
}
var tags []string
@ -51,7 +51,7 @@ func (o *Origin) TagsPayload() []byte {
tags = append(tags, o.tags...)
if len(tags) > 0 {
tagsPayload = append(tagsPayload, []byte("[dd ddtags=\""+strings.Join(tags, ",")+"\"]")...)
tagsPayload = append(tagsPayload, []byte("[fc fctags=\""+strings.Join(tags, ",")+"\"]")...)
}
if len(tagsPayload) == 0 {
tagsPayload = []byte{}