feat(apm): support stream name arg
This commit is contained in:
parent
ac71d2f5e3
commit
28251dad27
|
@ -114,3 +114,4 @@ fabric.properties
|
||||||
# Android studio 3.1+ serialized cache file
|
# Android studio 3.1+ serialized cache file
|
||||||
.idea/caches/build_file_checksums.ser
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|
4
apm.go
4
apm.go
|
@ -32,6 +32,7 @@ type OtelConfig struct {
|
||||||
ServiceName string
|
ServiceName string
|
||||||
ServiceVersion string
|
ServiceVersion string
|
||||||
Env string
|
Env string
|
||||||
|
StreamName string
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitOtelAPM(config OtelConfig) error {
|
func InitOtelAPM(config OtelConfig) error {
|
||||||
|
@ -46,6 +47,9 @@ func InitOtelAPM(config OtelConfig) error {
|
||||||
if config.AuthHeader != "" {
|
if config.AuthHeader != "" {
|
||||||
authHeaders["Authorization"] = config.AuthHeader
|
authHeaders["Authorization"] = config.AuthHeader
|
||||||
}
|
}
|
||||||
|
if config.StreamName != "" {
|
||||||
|
authHeaders["stream-name"] = config.StreamName
|
||||||
|
}
|
||||||
otlpHTTPExporter, err := otlptracehttp.New(context.Background(),
|
otlpHTTPExporter, err := otlptracehttp.New(context.Background(),
|
||||||
otlptracehttp.WithEndpoint(config.Endpoint),
|
otlptracehttp.WithEndpoint(config.Endpoint),
|
||||||
otlptracehttp.WithURLPath(config.Path),
|
otlptracehttp.WithURLPath(config.Path),
|
||||||
|
|
Loading…
Reference in New Issue