@@ -24,15 +24,17 @@ import (
24
24
)
25
25
26
26
const (
27
- collectorQueueSize = "collector.queue-size"
28
- collectorNumWorkers = "collector.num-workers"
29
- collectorPort = "collector.port"
30
- collectorHTTPPort = "collector.http-port"
31
- collectorGRPCPort = "collector.grpc-port"
32
- collectorGRPCTLS = "collector.grpc.tls"
33
- collectorGRPCCert = "collector.grpc.tls.cert"
34
- collectorGRPCKey = "collector.grpc.tls.key"
35
- collectorZipkinHTTPort = "collector.zipkin.http-port"
27
+ collectorQueueSize = "collector.queue-size"
28
+ collectorNumWorkers = "collector.num-workers"
29
+ collectorPort = "collector.port"
30
+ collectorHTTPPort = "collector.http-port"
31
+ collectorGRPCPort = "collector.grpc-port"
32
+ collectorGRPCTLS = "collector.grpc.tls"
33
+ collectorGRPCCert = "collector.grpc.tls.cert"
34
+ collectorGRPCKey = "collector.grpc.tls.key"
35
+ collectorZipkinHTTPort = "collector.zipkin.http-port"
36
+ collectorZipkinAllowedOrigins = "collector.zipkin.allowed-origins"
37
+ collectorZipkinAllowedHeaders = "collector.zipkin.allowed-headers"
36
38
)
37
39
38
40
// CollectorOptions holds configuration for collector
@@ -55,6 +57,10 @@ type CollectorOptions struct {
55
57
CollectorGRPCKey string
56
58
// CollectorZipkinHTTPPort is the port that the Zipkin collector service listens in on for http requests
57
59
CollectorZipkinHTTPPort int
60
+ // CollectorZipkinAllowedOrigins is a list of origins a cross-domain request to the Zipkin collector service can be executed from
61
+ CollectorZipkinAllowedOrigins string
62
+ // CollectorZipkinAllowedHeaders is a list of headers that the Zipkin collector service allowes the client to use with cross-domain requests
63
+ CollectorZipkinAllowedHeaders string
58
64
}
59
65
60
66
// AddFlags adds flags for CollectorOptions
@@ -68,6 +74,8 @@ func AddFlags(flags *flag.FlagSet) {
68
74
flags .Bool (collectorGRPCTLS , false , "Enable TLS" )
69
75
flags .String (collectorGRPCCert , "" , "Path to TLS certificate file" )
70
76
flags .String (collectorGRPCKey , "" , "Path to TLS key file" )
77
+ flags .String (collectorZipkinAllowedOrigins , "*" , "Allowed origins for the Zipkin collector service, default accepts all" )
78
+ flags .String (collectorZipkinAllowedHeaders , "content-type" , "Allowed headers for the Zipkin collector service, default content-type" )
71
79
}
72
80
73
81
// InitFromViper initializes CollectorOptions with properties from viper
@@ -81,5 +89,7 @@ func (cOpts *CollectorOptions) InitFromViper(v *viper.Viper) *CollectorOptions {
81
89
cOpts .CollectorGRPCCert = v .GetString (collectorGRPCCert )
82
90
cOpts .CollectorGRPCKey = v .GetString (collectorGRPCKey )
83
91
cOpts .CollectorZipkinHTTPPort = v .GetInt (collectorZipkinHTTPort )
92
+ cOpts .CollectorZipkinAllowedOrigins = v .GetString (collectorZipkinAllowedOrigins )
93
+ cOpts .CollectorZipkinAllowedHeaders = v .GetString (collectorZipkinAllowedHeaders )
84
94
return cOpts
85
95
}
0 commit comments