add trace_span_key & as_seperate_log_field configuration for ai-statistics (#2488)

This commit is contained in:
rinfx
2025-06-25 09:28:14 +08:00
committed by GitHub
parent f4d3fec228
commit 76ada0b844
5 changed files with 78 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/tidwall/gjson"
)
func unmarshalStr(marshalledJsonStr string) string {
func UnmarshalStr(marshalledJsonStr string) string {
// e.g. "{\"field1\":\"value1\",\"field2\":\"value2\"}"
var jsonStr string
err := json.Unmarshal([]byte(marshalledJsonStr), &jsonStr)
@@ -19,7 +19,7 @@ func unmarshalStr(marshalledJsonStr string) string {
return jsonStr
}
func marshalStr(raw string) string {
func MarshalStr(raw string) string {
// e.g. {"field1":"value1","field2":"value2"}
helper := map[string]string{
"placeholder": raw,