feat(apm): support stream name arg #1

Merged
sinhluu merged 1 commits from feat/add-stream-name into master 2025-02-05 02:39:31 +00:00
2 changed files with 5 additions and 0 deletions
Showing only changes of commit 28251dad27 - Show all commits

1
.gitignore vendored
View File

@ -114,3 +114,4 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
.idea

4
apm.go
View File

@ -32,6 +32,7 @@ type OtelConfig struct {
ServiceName string
ServiceVersion string
Env string
StreamName string
}
func InitOtelAPM(config OtelConfig) error {
@ -46,6 +47,9 @@ func InitOtelAPM(config OtelConfig) error {
if config.AuthHeader != "" {
authHeaders["Authorization"] = config.AuthHeader
}
if config.StreamName != "" {
authHeaders["stream-name"] = config.StreamName
}
otlpHTTPExporter, err := otlptracehttp.New(context.Background(),
otlptracehttp.WithEndpoint(config.Endpoint),
otlptracehttp.WithURLPath(config.Path),