Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace: honour tracing_service_name config directive #2608

Merged
merged 1 commit into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/unreleased/honour-tracing-service-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: respect the tracing_service_name config variable

https://github.com/cs3org/reva/pull/2608
2 changes: 1 addition & 1 deletion cmd/revad/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func initServers(mainConf map[string]interface{}, log *zerolog.Logger) map[strin
}

func initTracing(conf *coreConf) {
rtrace.SetTraceProvider(conf.TracingCollector, conf.TracingEndpoint)
rtrace.SetTraceProvider(conf.TracingCollector, conf.TracingEndpoint, conf.TracingServiceName)
}

func initCPUCount(conf *coreConf, log *zerolog.Logger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,16 @@ gatewaysvc = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="userprovidersvc" type="string" default="" %}}
The endpoint at which the GRPC userprovider is exposed. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L65)
{{< highlight toml >}}
[auth.manager.oidcmapping]
userprovidersvc = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="users_mapping" type="string" default="" %}}
The optional OIDC users mapping file path [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L66)
The optional OIDC users mapping file path [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L65)
{{< highlight toml >}}
[auth.manager.oidcmapping]
users_mapping = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="group_claim" type="string" default="" %}}
The group claim to be looked up to map the user (default to 'groups'). [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L67)
The group claim to be looked up to map the user (default to 'groups'). [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L66)
{{< highlight toml >}}
[auth.manager.oidcmapping]
group_claim = ""
Expand Down
9 changes: 7 additions & 2 deletions pkg/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ var (
)

// SetTraceProvider sets the TracerProvider at a package level.
func SetTraceProvider(collectorEndpoint string, agentEndpoint string) {
func SetTraceProvider(collectorEndpoint string, agentEndpoint, serviceName string) {
// default to 'reva' as service name if not set
if serviceName == "" {
serviceName = "reva"
}

var exp *jaeger.Exporter
var err error

Expand Down Expand Up @@ -75,7 +80,7 @@ func SetTraceProvider(collectorEndpoint string, agentEndpoint string) {
sdktrace.WithBatcher(exp),
sdktrace.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNameKey.String("reva"),
semconv.ServiceNameKey.String(serviceName),
)),
)
}
Expand Down