mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 00:46:15 -06:00
[feature] add support for sending headers to tracing system
Add support for sending additional HTTP or gRPC headers which can be used for authentication or other additional information for the tracing system without having to set up a local instance of the OpenTelemetry Collector to add these headers. Example with Dash0: ```yaml tracing-enabled: false tracing-transport: "grpc" tracing-endpoint: "ingress.eu-west-1.aws.dash0.com:4317" tracing-headers: "Authorization": "Bearer DASH0_AUTH_TOKEN" "Dash0-Dataset": "gotosocial" ``` Example with Honeycomb: ```yaml tracing-enabled: false tracing-transport: "grpc" tracing-endpoint: "api.honeycomb.io:443" tracing-headers: "x-honeycomb-team": "YOUR_API_KEY" "x-honeycomb-dataset": "YOUR_DATASET" ```
This commit is contained in:
parent
8504043024
commit
56204cc2f4
9 changed files with 48 additions and 4 deletions
|
|
@ -2191,6 +2191,22 @@ func (st *ConfigState) SetTracingEndpoint(v string) {
|
|||
st.reloadToViper()
|
||||
}
|
||||
|
||||
// GetTracingHeaders safely fetches the Configuration value for state's 'TracingHeaders' field
|
||||
func (st *ConfigState) GetTracingHeaders() (v map[string]string) {
|
||||
st.mutex.RLock()
|
||||
v = st.config.TracingHeaders
|
||||
st.mutex.RUnlock()
|
||||
return
|
||||
}
|
||||
|
||||
// SetTracingEndpoint safely sets the Configuration value for state's 'TracingHeaders' field
|
||||
func (st *ConfigState) SetTracingHeaders(v map[string]string) {
|
||||
st.mutex.Lock()
|
||||
defer st.mutex.Unlock()
|
||||
st.config.TracingHeaders = v
|
||||
st.reloadToViper()
|
||||
}
|
||||
|
||||
// TracingEndpointFlag returns the flag name for the 'TracingEndpoint' field
|
||||
func TracingEndpointFlag() string { return "tracing-endpoint" }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue