summaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@noreply.codeberg.org>2025-05-05 16:22:45 +0000
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-05-05 16:22:45 +0000
commitecbdc4227ba49eca622812b7413aa877318fd7a0 (patch)
tree37f441534f0f7673f72b8b1fa83ddc12db8ec95c /internal/config
parent[chore] Update goreleaser (#4133) (diff)
downloadgotosocial-ecbdc4227ba49eca622812b7413aa877318fd7a0.tar.xz
[chore] Simplify the OTEL setup (#4110)
# Description This simplifies our OTEL setup by: * Getting rid of some deprecated things. * Using `autoexport` and letting things get configured by the `OTEL_` environment variables. * Removing all the unnecessary config options. ## Checklist Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]` If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want). - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [ ] I/we have commented the added code, particularly in hard-to-understand areas. - [x] I/we have made any necessary changes to documentation. - [ ] I/we have added tests that cover new code. - [x] I/we have run tests and they pass locally with the changes. - [x] I/we have run `go fmt ./...` and `golangci-lint run`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4110 Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org> Co-authored-by: Daenney <daenney@noreply.codeberg.org> Co-committed-by: Daenney <daenney@noreply.codeberg.org>
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go12
-rw-r--r--internal/config/defaults.go9
-rw-r--r--internal/config/helpers.gen.go150
3 files changed, 4 insertions, 167 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 88083d491..2c4035ecf 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -145,16 +145,8 @@ type Configuration struct {
OIDCLinkExisting bool `name:"oidc-link-existing" usage:"link existing user accounts to OIDC logins based on the stored email value"`
OIDCAllowedGroups []string `name:"oidc-allowed-groups" usage:"Membership of one of the listed groups allows access to GtS. If this is empty, all groups are allowed."`
OIDCAdminGroups []string `name:"oidc-admin-groups" usage:"Membership of one of the listed groups makes someone a GtS admin"`
-
- TracingEnabled bool `name:"tracing-enabled" usage:"Enable OTLP Tracing"`
- TracingTransport string `name:"tracing-transport" usage:"grpc or http"`
- TracingEndpoint string `name:"tracing-endpoint" usage:"Endpoint of your trace collector. Eg., 'localhost:4317' for gRPC, 'localhost:4318' for http"`
- TracingInsecureTransport bool `name:"tracing-insecure-transport" usage:"Disable TLS for the gRPC or HTTP transport protocol"`
-
- MetricsEnabled bool `name:"metrics-enabled" usage:"Enable OpenTelemetry based metrics support."`
- MetricsAuthEnabled bool `name:"metrics-auth-enabled" usage:"Enable HTTP Basic Authentication for Prometheus metrics endpoint"`
- MetricsAuthUsername string `name:"metrics-auth-username" usage:"Username for Prometheus metrics endpoint"`
- MetricsAuthPassword string `name:"metrics-auth-password" usage:"Password for Prometheus metrics endpoint"`
+ TracingEnabled bool `name:"tracing-enabled" usage:"Enable OTLP Tracing"`
+ MetricsEnabled bool `name:"metrics-enabled" usage:"Enable OpenTelemetry based metrics support."`
SMTPHost string `name:"smtp-host" usage:"Host of the smtp server. Eg., 'smtp.eu.mailgun.org'"`
SMTPPort int `name:"smtp-port" usage:"Port of the smtp server. Eg., 587"`
diff --git a/internal/config/defaults.go b/internal/config/defaults.go
index 4ef183aa6..7e1d234f3 100644
--- a/internal/config/defaults.go
+++ b/internal/config/defaults.go
@@ -122,13 +122,8 @@ var Defaults = Configuration{
SMTPFrom: "",
SMTPDiscloseRecipients: false,
- TracingEnabled: false,
- TracingTransport: "grpc",
- TracingEndpoint: "",
- TracingInsecureTransport: false,
-
- MetricsEnabled: false,
- MetricsAuthEnabled: false,
+ TracingEnabled: false,
+ MetricsEnabled: false,
SyslogEnabled: false,
SyslogProtocol: "udp",
diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go
index 8fc4475b7..b039d26a5 100644
--- a/internal/config/helpers.gen.go
+++ b/internal/config/helpers.gen.go
@@ -2306,81 +2306,6 @@ func GetTracingEnabled() bool { return global.GetTracingEnabled() }
// SetTracingEnabled safely sets the value for global configuration 'TracingEnabled' field
func SetTracingEnabled(v bool) { global.SetTracingEnabled(v) }
-// GetTracingTransport safely fetches the Configuration value for state's 'TracingTransport' field
-func (st *ConfigState) GetTracingTransport() (v string) {
- st.mutex.RLock()
- v = st.config.TracingTransport
- st.mutex.RUnlock()
- return
-}
-
-// SetTracingTransport safely sets the Configuration value for state's 'TracingTransport' field
-func (st *ConfigState) SetTracingTransport(v string) {
- st.mutex.Lock()
- defer st.mutex.Unlock()
- st.config.TracingTransport = v
- st.reloadToViper()
-}
-
-// TracingTransportFlag returns the flag name for the 'TracingTransport' field
-func TracingTransportFlag() string { return "tracing-transport" }
-
-// GetTracingTransport safely fetches the value for global configuration 'TracingTransport' field
-func GetTracingTransport() string { return global.GetTracingTransport() }
-
-// SetTracingTransport safely sets the value for global configuration 'TracingTransport' field
-func SetTracingTransport(v string) { global.SetTracingTransport(v) }
-
-// GetTracingEndpoint safely fetches the Configuration value for state's 'TracingEndpoint' field
-func (st *ConfigState) GetTracingEndpoint() (v string) {
- st.mutex.RLock()
- v = st.config.TracingEndpoint
- st.mutex.RUnlock()
- return
-}
-
-// SetTracingEndpoint safely sets the Configuration value for state's 'TracingEndpoint' field
-func (st *ConfigState) SetTracingEndpoint(v string) {
- st.mutex.Lock()
- defer st.mutex.Unlock()
- st.config.TracingEndpoint = v
- st.reloadToViper()
-}
-
-// TracingEndpointFlag returns the flag name for the 'TracingEndpoint' field
-func TracingEndpointFlag() string { return "tracing-endpoint" }
-
-// GetTracingEndpoint safely fetches the value for global configuration 'TracingEndpoint' field
-func GetTracingEndpoint() string { return global.GetTracingEndpoint() }
-
-// SetTracingEndpoint safely sets the value for global configuration 'TracingEndpoint' field
-func SetTracingEndpoint(v string) { global.SetTracingEndpoint(v) }
-
-// GetTracingInsecureTransport safely fetches the Configuration value for state's 'TracingInsecureTransport' field
-func (st *ConfigState) GetTracingInsecureTransport() (v bool) {
- st.mutex.RLock()
- v = st.config.TracingInsecureTransport
- st.mutex.RUnlock()
- return
-}
-
-// SetTracingInsecureTransport safely sets the Configuration value for state's 'TracingInsecureTransport' field
-func (st *ConfigState) SetTracingInsecureTransport(v bool) {
- st.mutex.Lock()
- defer st.mutex.Unlock()
- st.config.TracingInsecureTransport = v
- st.reloadToViper()
-}
-
-// TracingInsecureTransportFlag returns the flag name for the 'TracingInsecureTransport' field
-func TracingInsecureTransportFlag() string { return "tracing-insecure-transport" }
-
-// GetTracingInsecureTransport safely fetches the value for global configuration 'TracingInsecureTransport' field
-func GetTracingInsecureTransport() bool { return global.GetTracingInsecureTransport() }
-
-// SetTracingInsecureTransport safely sets the value for global configuration 'TracingInsecureTransport' field
-func SetTracingInsecureTransport(v bool) { global.SetTracingInsecureTransport(v) }
-
// GetMetricsEnabled safely fetches the Configuration value for state's 'MetricsEnabled' field
func (st *ConfigState) GetMetricsEnabled() (v bool) {
st.mutex.RLock()
@@ -2406,81 +2331,6 @@ func GetMetricsEnabled() bool { return global.GetMetricsEnabled() }
// SetMetricsEnabled safely sets the value for global configuration 'MetricsEnabled' field
func SetMetricsEnabled(v bool) { global.SetMetricsEnabled(v) }
-// GetMetricsAuthEnabled safely fetches the Configuration value for state's 'MetricsAuthEnabled' field
-func (st *ConfigState) GetMetricsAuthEnabled() (v bool) {
- st.mutex.RLock()
- v = st.config.MetricsAuthEnabled
- st.mutex.RUnlock()
- return
-}
-
-// SetMetricsAuthEnabled safely sets the Configuration value for state's 'MetricsAuthEnabled' field
-func (st *ConfigState) SetMetricsAuthEnabled(v bool) {
- st.mutex.Lock()
- defer st.mutex.Unlock()
- st.config.MetricsAuthEnabled = v
- st.reloadToViper()
-}
-
-// MetricsAuthEnabledFlag returns the flag name for the 'MetricsAuthEnabled' field
-func MetricsAuthEnabledFlag() string { return "metrics-auth-enabled" }
-
-// GetMetricsAuthEnabled safely fetches the value for global configuration 'MetricsAuthEnabled' field
-func GetMetricsAuthEnabled() bool { return global.GetMetricsAuthEnabled() }
-
-// SetMetricsAuthEnabled safely sets the value for global configuration 'MetricsAuthEnabled' field
-func SetMetricsAuthEnabled(v bool) { global.SetMetricsAuthEnabled(v) }
-
-// GetMetricsAuthUsername safely fetches the Configuration value for state's 'MetricsAuthUsername' field
-func (st *ConfigState) GetMetricsAuthUsername() (v string) {
- st.mutex.RLock()
- v = st.config.MetricsAuthUsername
- st.mutex.RUnlock()
- return
-}
-
-// SetMetricsAuthUsername safely sets the Configuration value for state's 'MetricsAuthUsername' field
-func (st *ConfigState) SetMetricsAuthUsername(v string) {
- st.mutex.Lock()
- defer st.mutex.Unlock()
- st.config.MetricsAuthUsername = v
- st.reloadToViper()
-}
-
-// MetricsAuthUsernameFlag returns the flag name for the 'MetricsAuthUsername' field
-func MetricsAuthUsernameFlag() string { return "metrics-auth-username" }
-
-// GetMetricsAuthUsername safely fetches the value for global configuration 'MetricsAuthUsername' field
-func GetMetricsAuthUsername() string { return global.GetMetricsAuthUsername() }
-
-// SetMetricsAuthUsername safely sets the value for global configuration 'MetricsAuthUsername' field
-func SetMetricsAuthUsername(v string) { global.SetMetricsAuthUsername(v) }
-
-// GetMetricsAuthPassword safely fetches the Configuration value for state's 'MetricsAuthPassword' field
-func (st *ConfigState) GetMetricsAuthPassword() (v string) {
- st.mutex.RLock()
- v = st.config.MetricsAuthPassword
- st.mutex.RUnlock()
- return
-}
-
-// SetMetricsAuthPassword safely sets the Configuration value for state's 'MetricsAuthPassword' field
-func (st *ConfigState) SetMetricsAuthPassword(v string) {
- st.mutex.Lock()
- defer st.mutex.Unlock()
- st.config.MetricsAuthPassword = v
- st.reloadToViper()
-}
-
-// MetricsAuthPasswordFlag returns the flag name for the 'MetricsAuthPassword' field
-func MetricsAuthPasswordFlag() string { return "metrics-auth-password" }
-
-// GetMetricsAuthPassword safely fetches the value for global configuration 'MetricsAuthPassword' field
-func GetMetricsAuthPassword() string { return global.GetMetricsAuthPassword() }
-
-// SetMetricsAuthPassword safely sets the value for global configuration 'MetricsAuthPassword' field
-func SetMetricsAuthPassword(v string) { global.SetMetricsAuthPassword(v) }
-
// GetSMTPHost safely fetches the Configuration value for state's 'SMTPHost' field
func (st *ConfigState) GetSMTPHost() (v string) {
st.mutex.RLock()